LEARN TO SCRIPT #3 - Code Blocks, If Statements, While Loops
Take your scripting knowledge to the next level! We look at code blocks, conditionals, if statements and while loops. Which we then combine to create a virtual football game simulation!
FILES ►gnome.codes/LearnToScript/
DISCORD ► / discord
TWITTER ►@gnomecodeRBLX
MUSIC
Aerosol Of My Love by Kevin MacLeod
Link: filmmusic.io/song/7013-aeroso...
License: filmmusic.io/standard-license
Пікірлер: 203
By far my favorite Roblox scripting channel. Keep up the incredible work.
@GnomeCode
3 жыл бұрын
Thanks for the good vibes!
@unstoppableluckq9985
2 жыл бұрын
@@GnomeCode you had the key!
@CheesingBall
Жыл бұрын
agreed
@apollopingu
Жыл бұрын
agreed
@herograaf5850
Жыл бұрын
AGREED
This is the only channel that has thought me anything every other channel expects you to know everything
i've tried for over 4 years to learn how to script. this is the first time information is actually sticking to the peanut that is my brain, thank you so much for these tutorials!
@DoYourFrench
4 ай бұрын
Me too but just 1 day
@DoYourFrench
4 ай бұрын
Going on comment and found people that they learned from gnome and im here im learning faster than eishtein (okay its my spécial mind but comparing this is easier)
19:44 "We could get in trouble for that if we were in the gambling business" Nervous Chuckle
This guy really helped me learn to script
@baileygobrr
3 жыл бұрын
cant wait to see shrek be the next famous roblox developer
@Trazor_
2 жыл бұрын
@@baileygobrr that would be amazing xD
since i've learned from you i put a * goal = "GOOOOOAAAAALLL!!"* as a variable in the start of the script tysm for teaching us!
You are the first youtuber to ever dumb it down enough to where i understand scripting
@UltraDubzYT
Жыл бұрын
also my halftime isn't working
@UltraDubzYT
Жыл бұрын
im not finished with the video yet so maybe i will see a flaw in my code
@UltraDubzYT
Жыл бұрын
fixed it 1 minute later lol
@UltraDubzYT
Жыл бұрын
i added a part of the script anyone can use it in their game just credit me -- Ultra's Soccer Game team1 = "Ronaldo" team2 = "Messi" team1score = 0 team2score = 0 minutes = 0 while minutes if minutes == 45 then print("HALFTIME") wait(3) elseif minutes == 90 then print("FULLTIME") elseif minutes == 37 then team1score = team1score +1 elseif minutes == 73 then team2score = team2score +2 else print(team1, team1score, team2, team2score) print(minutes) wait(0.2) end minutes = minutes + 1 end if team1score > team2score then print("Messi wins the world cup! lets play football world cuuup") else print("Ronaldo wins SUIIIIIIIIII") end wait(1) print("But wait...") wait(3) print("Messi makes a comeback!") wait(2) team1score = team1score + 9999999999999 print(team1, team1score, team2, team2score) if team1score > team2score then print("Messi wins the world cup! lets play football world cuuup") else print("Ronaldo wins SUIIIIIIIIII") end
@crosssans9984
10 ай бұрын
@@UltraDubzYT what
This helped me a lot! I just wanna say Thank you for making these scripting tutorials video.
That intro was amazing, I was having a really bad day but it instantly made my mood better
Ha! the video started buffering right when he was waiting to break the studio with the While function XD I was like, "DANG that while command IS powerful"
Thx now I know how to script a lot of sentences You are my fav scripting youtuber =)
i wrote this while following the totorial this would have looked like machine gibberish before i followed the totorial you are a great teacher! team1 = "e" team2 = "a" team1score = 0 team2score = 0 minutes = 0 while minutes if minutes == 16 then print("its halftime now") wait(3) elseif minutes == 10 then team1score = team1score + 1 print("team 1 scored a goal") elseif minutes == 20 then team2score = team2score + 1 print("team 2 scored a goal!") elseif minutes == 25 then team2score = team2score + 1 print("team 2 scored another goal!!") else print(team1, team1score, team2, team2score) wait(1) end minutes = minutes + 1 end if minutes == 32 then print("the match has ended") elseif minutes print("the match didnt end yed") end if team2score > team1score then print("team 2 has won!") elseif team2score print("team 1 won!") end
@GnomeCode
3 жыл бұрын
Great work!
@xperiorTR
3 жыл бұрын
@@GnomeCode i couldnt have wrote it without your totorial! and please keep making these videos not only are they fun to watch they are also fun to follow and they teach a lot of stuff!
Amazing! I’ve been looking for a tutorial like this for weeks! Thanks
@Raddius
Жыл бұрын
That's a lie you just searched "how to script on Roblox" and found it.
@fireslime
Жыл бұрын
@@Raddius i went through loop holes to get here. the search didnt lead my anywhere
I thought you stopped lol awesome to know its back
YOU ARE THE MOST BRILLIANT PERSON I KNOW! YOU HAVE ACTUALLY TAUGHT ME A LOT UNLIKE MANY OTHERS
@FTBALL136
9 ай бұрын
Me too Thank you so much
this Tutorial though was very cool keep it up Gnome :D
So informative thank you.
You are amazing, I've learned so much
This is so cool and im able to follow along however i think i will still have trouble making my own game.
Thank you! You teach me not only scripting in roblox but also English.
Gnone code is a goattt 🐐
Thank you this helped me alot!
This is better than alvin blox. You actually get to make a game instead of learning boring scripting.
this the best vid, i use to be a free modeler but i got sick of it and now scripting
As a Qbasic beginner programmer, I can say this is quite easy to understand
aaaayyyyyyyyyyyyyy ik how to do variables from last episode! KEEP IT UP BRO
@crosssans9984
10 ай бұрын
same
I love gnome code!!!!
Back and better than ever
@Spiresnipers
3 жыл бұрын
Yep
ur very helpful thankx
This gives me an Idea of a game that you play in Roblox studio in the script
Could you do a tutorial how to do a power box if you turn it off all lights wont work and if you turn if back on the lights work again
finally a new episode
I’m right now making a obby! I tested it!it’s so good
another super vid
Thx helping a lot
Thanks! Now I know how to rig a football game so I always win :3
@GnomeCode
2 жыл бұрын
That's the spirit!
Finally After so lobg
how to redisplay the variable at the top of the script display? 10:28
So while command is good for making boss respawn time
Very useful
ah mr gnome code i have been expecting you
POG intro
Hey :). Could you tell me how you made the trains in Mafia city move by themselves or just rigging it? I have trouble making vehicles and I was wondering if you could do a vehicle tutorial or something, because they never work for me.
@GnomeCode
3 жыл бұрын
The trains weren't rigged, they just use constraints to keep the sections together. I believe I covered a basic overview of how they work in the actual video.
Finally 😄
When i do it it just says something about this promise script or something i never even had a promise script and it didnt work
Gnomecode ; calls me cringe me cringe because I don’t know how to script . Me who already knows how to script but am watching this because i like gnomecode; (Sorry that i forgot the funny part)
Yessssssssssssssssss i can script (I haven't watched it yet lol)
Could you do a video on how to make a game like arsenal or a FPS.
on 7:47 Me: Let me run the game idk why GnomeCode 5 seconds later: DO NOT run or u might crash roblox studio!
best roblox scripting channel
LOL, I forgot you were even doing these!
@GnomeCode
3 жыл бұрын
Welcome back!
a gnome upload impossible
9:03 for me it printed 139,833 times and roblox studio still didnt crash. do I have an awesome pc like how?
end didnt show up on me
i don't know if you still respond to messages on these videos, but is there a way to incorperate RNG into the script you make in the latter half of the video. I'd love to have a random game happen in the output rather than have to code every single goal like seen at 18:59. I'm aware of math.random and i'm wondering how i can trigger something happening based on the resulting number. I feel that teaching us how to do this would have really added on to the video giving us a brief glimpse into the more advanced aspects of coding,
@GnomeCode
9 ай бұрын
Yup, you can generate a random number between 1 and 10 like this: number = math.random(1,10) You could then have various if statements that change the outcome of the game depending on what the number is. Hope that helps!
19:23 When he said GOOOOOAL it sounded like technoblade's voice... TECHNOBLADE NEVER DIES
says that we are cringe, but then teaches us how to 'not' be cringe... amazing
he took maths class more than scripting
I don’t understand the word closing on line 7 and stuff to close “)”
Wow now that’s a deal
It’s still in progress
another way for the printing you could use is this: myName = "Noah" if myName == "Noah" then print("Hello My Name Is "..myName) else print("My Name Is Not "..myName
@YungNoahX
Жыл бұрын
Did it work?
YAYYYY
Best thing for passwords
Gnome Gode
what editing software you used?
@GnomeCode
3 жыл бұрын
I use Hitfilm Express for all my videos
15:24 i kinda managed to fix the problem, i just wrote this: team1 = "ChadBacons" team2 = "CringySlenders" team1Score = 0 team2Score = 0 minutes = 0 while minutes if minutes == 45 then print("HALF TIME") wait(3) elseif minutes == 90 then print("FULL TIME") else end print(team1, team1Score, team2, team2Score) minutes = minutes + 1 print(minutes) wait(0.2) end
number = 6 done = false while number > 3 do if done == false then print(number.. " is still greater than 3") number = number - 1 elseif number done = true end end (just to use the script without making ur studio crash basically it will make the number go down until it becomes 2 cuz it will no more be greater than 3 idk if it works i didn't try it since i just made the script inside the youtube comments)
@GnomeCode
3 жыл бұрын
Almost! You would need to define your 'done' variable at the top
@Spooky.Studios
3 жыл бұрын
@@GnomeCode yeah i did forget it
Line 15 won't work for me
So I ran it with the while loop. R.I.P My Save
GnomeCode: Yeah so don't run this code me who already ran it: uhhh
🥳🥳
73 likes and 0 dislikes, thats how you know this is a good video
@esculayte661
3 жыл бұрын
@TheRandom Player 101*
@esculayte661
3 жыл бұрын
@@HarryDKH 113
@crosssans9984
10 ай бұрын
1.1k *
@esculayte661
9 ай бұрын
@@crosssans9984 dawg this comment is from 2 years ago
"Whaaaa? its 2021 and you still haven't know how to script?! you are cringe!" me that just started learning in 2022:
8:51 mine printed 68039 times before giving up
Mine didn't loop
GnomeCode can you do chapter 4 the sewers
im having fun scripting for some reason lol
Anybody else heard a cat meowing or is it just me 6:46
Me who ran the while loop before he said not to: ;-;
Where is Teddy chapter 3 speed build? Please respond
@GnomeCode
3 жыл бұрын
On my hard drive. All 30 hours of it.
@ElderWizard
3 жыл бұрын
@@GnomeCode ok
Gnome
Wait, new video? IMPOSSIBLE
I did not understand:( but the video is top :) 🌿
@crosssans9984
10 ай бұрын
why
5:58 don’t mind me saving time stamps lol
i paused the video and tried to run the while code like 6 times hahahahaha
9:00 aight bro we get it , 5 > 3 ☠
sorry my brain got exploded.
Bread
my brainn is fried but i still understood everything u said and... FOR SOME DUMB REASON U CAN TEACH US THE UNTEACHABLE HOW XD?
aye
I immediately pressed run on the script that we were not supposed to run and I completely crashed my entire computer
yeah its cringe but what coding language is this? I really like this one
11,111 views, nice
12:35
8:13 "DO NOT RUN THIS CODE" Me who's already ran the code
ayo you wroted the script in 26 lines and i wrote it in 37
if theres anything you guys dont understand ask me
what do i do when this message shows up ;'' Downloading asset failed for asset id 5112309884. Is the asset id correct and is the asset type "Model"?''? it keeps on happening and i think it prevents my scripts form working.