REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE If your reading this reply then it might be to late to save me I'm mentally exhausted to keep moving foward. I feel like falling apart but I can't I want to cry but I can't I don't want to do anything but I must. I just want to sleep I just want to go home but I don't think it possible
This is random, but can I just express how much I love Else if statements? They're absolute life savers. I was writing a script in another programming language a while back and I didn't know that Else if statements existed and the script essentially depended on them to function correctly. I finally found out that they existed and I was able to finally finish that program and move on. Okay, rant over. All of that aside, fantastic tutorial. Thanks (:
@@hiro3667 Don't worry, the over use of prints in these scripts are just helping you get down the basics of everything else. You wont use 100% prints to make a sword explode in the sky or something 😂
Even if you know every syntax and arguments in the coding language, it'll still very hard to program a game. Like, you won't be knowing what to use to make the game working, but that's the fun in coding. It takes you time and effort to make a whole proper game, and you'll have to appreciate it. That's what I am looking for in coding.
@@KerbalChris no problem man, lemme set ya up with an infinite supply. while true do local HotDog = Instance.new(HotDog) HotDog.Parent = Kerbal wait(0.1) end
I tried watching other tutorials and spent half a hour tryin to learn what variables were and didnt understand but with you i learned it in less then 10 mins
TheDevKing I'm watching from the playlist but I'd just like to say, you have helped me out a lot so far, and I understand scripting better then I did before.
@@vrfrenzy8451 Bruh then don't call him God just say he is a great person, you using God as a term means you really don't know the scale of this word. I never said you aren't allowed to thank him
Okay so I wanted to get into scripting because I've always wanted to, and someone suggested "Hey you should first learn roblox coding" and I think choosing this channel to learn was a good choice. Thank you for these masterpiece tutorials. Next up: Tutorial 10. Amazing teaching!
tbh roblox scripting is not the best pick, as somebody who's learning this as my 4th language. Try scratch if you want to learn the general stuff behind how code works, anything beyond that is mostly just syntax and language quirks.
This is much more complicated than the other ones, but still handy. I'm literally righting everything you say down in a book so my small brain can remember. Cheers bro.
Jeez this guy has taught me more than 3 months of learning in a week. I used to be struggling moving from youtuber to youtuber at least he's determined at set a goal to teach us! Thanks man you deserve a lot more subs!
@@Bloav Ikr ! I watched his video for 1 hour (not all of the playlist tho bc right now I'm on this one) and I learned more than all I learned from 1 year on roblox studio lmao
This feature could be used for detecting if a player has bought a gamepass or not, and if they try to do an action that they need the gamepass for (Entering a VIP only lounge), they will either be let in (If part) or they wont be able to get in (Else part). Pretty useful.
This is 4 years late, but from what I understand of elseif is that if the if statement doesn't pass, it will run another if statement. example local variable = 5 if variable == 7 then print("variable is 7") --If not passed run next elseif statement elseif variable == 5 then print("Variable is 5") --Passes so doesn't run next statement elseif variable ==3 then print("Variable is 3") end
If you want you can replace the top line for this It will do random numbers up to four whatever you choose local hotdog = math.random(4) - - this is math.random Its the number randomiser
Basically, If you used scratch before you might remember something like The If Else block. The else statement basically works like that. If the If statement is false, then the else statement will run.
This is a random script I made using the tutorials you showed so far :) local x = math.random(2,3) local y = math.random(8,9) if x == 3 and y == 9 then print("YES") elseif x == 2 and y == 8 then print("UNLUCKY")
hey, do u know what number after math.random means?? i just try to understand. like does it mean a random number will go up to the one u put in those ( )
@@abandonedddreamstation math.random means it just picks a random number each time the game runs, like for example: math.random(1,100) the script will choose a random number with that range, so yeah you are correct
There are some very interesting things you can do with the language that we got in the past 9 episodes! --Variables local Price = --The price of the item. local Money = --The amount of money you have. --Code if Money > Price or Money == Price then --This means that the ''Money'' Variable is higher or equal to Price. Money = Money-Price --This will set the Money variable to what it is after the price is substracted from it! print("Bought") print("Money Left :") --Basically just prints stuff print(Money) else print("Not enough money!") end
I am loving how these tutorials are so easy to understand! i would recommend you to play around with what you learn in each episode to learn some things that TheDevKing didn't show us, or didn't show us yet! :D
you can also print the money left in the same line with .. or , for ex local m = 9 local price = 1 print("Item price " .. price) -- YOU HAD TO PUT SPACE HERE print("Money", m) -- no space In my opinion, ',' is better.
Ohh yeah, it was an ad on that GameMaker thing saying if we'ere tired of Junky game makers even though roblox is actually really good and was using a literall tutorial to say roblox is a junky game engine even though its actually really good!
How would i make it more than one number for example if the money is any number under zero, a part turns red, and then if the money is above 0 the part turns green
yandere dev learning this: local yandere=7 if yandere=1 then print ("oh no") elseif yandere=2 then print ("oh no, try again") elseif yandere=3 then print ("oh no, try again still") elseif yandere=4 then print ("ugh stop it") elseif yandere=5 then print (":C") elseif yandere=6 then print (">:C STOP") elseif yandere=7 then print ("finally I got it!") elseif yandere=8 then print ("WHAT ?!? TURN AROUND") elseif yandere=9 then print ("GO BACK!!!") elseif yandere=10 then print ("STOP THIS NOWW") end
So if i wanted to make a level up game and you needed a level requirement and every time they try to accept a quest if they aren’t the required level i could use this? to show a gui that popes up everytime you try to accept the quest? just asking for better understanding thanks!
Here is an example you can use else and if statement- Suppose a weapon cost 100 and you only have 70 and you try to buy it, you want to make it so that a error comes saying 'not enough money', here you can use else and if statement by simply putting else 'Not enough money'.
@@hiro3667 like I said it can be used for anything, rn I can't think of an example sorry but it is really useful for beginners. He is teaching else and elseif, and the others are just examples to use else and elseif, it's more understandable when you're actually scripting.
Hi all - I am relatively new to this, is it possible to compare block colors in IF statements. e.g if 1 block color == really red then change the transparency of another block?
Breaking news, hot dogs isn’t equal to 3. This is an absolute tragedy for mankind however it may mean TheDevKing won’t eat 5 hotdogs every tutorial. This is good, unless if he really likes hotdogs, which is true because he has made hotdog variables equal to awesome I believe.
Hey guys! Be sure to join the discord server if you have any questions or if you would like to meet me! discord.gg/FKcSyRh
Somehow, I will be first like on this comment, 9 months later.
Yeah I got it but how I can change that in the game?
hi u made me pro scripter
Thank you so much man you really helped me understand 👌👌😁👍👍
He loves hotdogs
he really likes hotdogs lol
was gonna say whys he addicted to em
("Glizzy")
REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
If your reading this reply then it might be to late to save me I'm mentally exhausted to keep moving foward. I feel like falling apart but I can't I want to cry but I can't I don't want to do anything but I must. I just want to sleep I just want to go home but I don't think it possible
[Comment deleted]
He is a glizzy gobler
This lesson was very simple and understandable you're an amazing teacher.
True
@Swiftier mhm same
very true
awesome true
fr
i watched all 9 tutorials and i already feel like a developer
Same man.
i dont
Same
Yep
Same
This is random, but can I just express how much I love Else if statements? They're absolute life savers. I was writing a script in another programming language a while back and I didn't know that Else if statements existed and the script essentially depended on them to function correctly. I finally found out that they existed and I was able to finally finish that program and move on.
Okay, rant over. All of that aside, fantastic tutorial. Thanks (:
bro you are absolutely right else if statements literally one of the most useful things ever
Simple and understandable? Ya really know how to teach!
he does
He makes it sound so simple, all the other tutorials I have seen don't. Thank you so much man!
I FEEL SO SMART WATCHING THESE EVEN THOUGH ITS JUST BASIC MATH AND ELSE AND ELSEIFS AND STUFF THIS MAKES ME SO HAPPY
Same
where would you use any of these things in like a real script? thats the only confusing thing to me
@@hiro3667 you use them all the time
@@hiro3667 Don't worry, the over use of prints in these scripts are just helping you get down the basics of everything else. You wont use 100% prints to make a sword explode in the sky or something 😂
hes always gotta make sure he has 3 hotdogs. Nothing less, nothing more.
Ikr
lmao
summrs?
Even if you know every syntax and arguments in the coding language, it'll still very hard to program a game. Like, you won't be knowing what to use to make the game working, but that's the fun in coding. It takes you time and effort to make a whole proper game, and you'll have to appreciate it. That's what I am looking for in coding.
Just start by making simple kill bricks without and help, or making a part change colour with a while loop, you can also make a simple obby
Making a mistake and fixing it will complete my life
It makes you feel proud of yourself
Nah look up how to make specific stuff on devforum and practice them. It will just take time.
The amount of potential that "Else" and "elseif" statements have is just unimaginable. Also, you're an expert in teaching I love it.
this lesson is actually easy
I came for re-learning how to set up the if else statements, but now I want hotdogs
local HotDog = Instance.new(HotDog)
HotDog.Parent = Kerbal
DOGGO_ Woo thanks man
@@KerbalChris no problem man, lemme set ya up with an infinite supply.
while true do
local HotDog = Instance.new(HotDog)
HotDog.Parent = Kerbal
wait(0.1)
end
@@doggo_woo Bro you're spawning a hot dog every half second he wont be able to do any work!
@@theaverageperson8026 HE WILL SELL THOSE AND BECOME A BILLIONARE!
I tried watching other tutorials and spent half a hour tryin to learn what variables were and didnt understand but with you i learned it in less then 10 mins
local cat = "cool"
if cat == "cool" then
Reply
end
TheDevKing I'm watching from the playlist but I'd just like to say, you have helped me out a lot so far, and I understand scripting better then I did before.
you're a god! I went from not knowing a thing to being able to start writing little bits of code!
me to
Same
no he's not a God stop calling people that because they helped you with a struggle or because they are better at you in something
@@gdog8170 :/ am I not allowed to thank someone, ofc he isn't a god. Its a term I used for him being so awesome. Stop being so literal : |
@@vrfrenzy8451 Bruh then don't call him God just say he is a great person, you using God as a term means you really don't know the scale of this word. I never said you aren't allowed to thank him
Okay so I wanted to get into scripting because I've always wanted to, and someone suggested "Hey you should first learn roblox coding" and I think choosing this channel to learn was a good choice. Thank you for these masterpiece tutorials. Next up: Tutorial 10. Amazing teaching!
tbh roblox scripting is not the best pick, as somebody who's learning this as my 4th language. Try scratch if you want to learn the general stuff behind how code works, anything beyond that is mostly just syntax and language quirks.
You are literally the only Roblox scripting yt'r I have seen who actually explains logic gates 10/10
He really is the king of developing, if he teaches it this well, imagine how good he is at making games.
This is much more complicated than the other ones, but still handy. I'm literally righting everything you say down in a book so my small brain can remember. Cheers bro.
Jeez this guy has taught me more than 3 months of learning in a week. I used to be struggling moving from youtuber to youtuber at least he's determined at set a goal to teach us! Thanks man you deserve a lot more subs!
This could really be learned in a day.
@@Bloav Ikr ! I watched his video for 1 hour (not all of the playlist tho bc right now I'm on this one) and I learned more than all I learned from 1 year on roblox studio lmao
@@alex_valden yeah but keep practicing! i've done like what you did before but i didn't practice so i forgot all the basic things!
@@retrofilmwork I'm also making games in the meanwhile so I'm still practicing :) 👍🏻
-Alexou Le Neko- Oh wow! Thats great! What game are you planning on? Mine is like a simple medieval game
This feature could be used for detecting if a player has bought a gamepass or not, and if they try to do an action that they need the gamepass for (Entering a VIP only lounge), they will either be let in (If part) or they wont be able to get in (Else part). Pretty useful.
Actually the else part is redundant but you can make it activate a pop-up to buy the gamepass.
@@gabrielc7861 i can tell your code is tidy
I think I finally get it. Elseif's are basically saying, unless if this is this then this will happen.
You got it.
@@Laderrr wow, I really need to be more active with learning. 11 months ago and I'm only on i,v pairs ;-; this is depressing LOL
This is 4 years late, but from what I understand of elseif is that if the if statement doesn't pass, it will run another if statement.
example
local variable = 5
if variable == 7 then
print("variable is 7") --If not passed run next elseif statement
elseif variable == 5 then
print("Variable is 5") --Passes so doesn't run next statement
elseif variable ==3 then
print("Variable is 3")
end
This guy makes the best tutorials on scripting, i learned half of the basics across all of the 19 videos in one hour.
This beginner tutorials are the best scripting tutorials I've ever seen!
If you want you can replace the top line for this It will do random numbers up to four whatever you choose
local hotdog = math.random(4) - - this is math.random Its the number randomiser
Dude is the Indian math teacher on TH-cam equivalent of coding teacher
Basically, If you used scratch before you might remember something like
The If Else block.
The else statement basically works like that. If the If statement is false, then the else statement will run.
idk how u do this but u teach a whole "topic" in just a few minutes in one video
Hotdogs: **Exist**
DevKing: *L O C A L*
This man has serious dedication, he recorded this at 12 AM
I wrote 22 lines of code and it works, I'm proud of myself. 🙃 (Thanks for making a video on how to script!)
This is a random script I made using the tutorials you showed so far :)
local x = math.random(2,3)
local y = math.random(8,9)
if x == 3 and y == 9 then
print("YES")
elseif x == 2 and y == 8 then
print("UNLUCKY")
else print("NO")
end
print(x)
print(y)
hey, do u know what number after math.random means?? i just try to understand. like does it mean a random number will go up to the one u put in those ( )
@@abandonedddreamstation math.random means it just picks a random number each time the game runs, like for example:
math.random(1,100)
the script will choose a random number with that range, so yeah you are correct
dang, nice job man, idk how you caught on so fast js keep doing what ur doing.
@@Czyborg yay lol
2:00
DevKing: "Hotdogs isnt equal to three"
Script: "local Hotdogs = 3"
this man is more experienced than a fully experienced computer coding scientist
This dude is addicted to hotdogs
ur killing me with all the hotdog usage
2021 just now learning lua. Thanks for helping!
There are some very interesting things you can do with the language that we got in the past 9 episodes!
--Variables
local Price = --The price of the item.
local Money = --The amount of money you have.
--Code
if Money > Price or Money == Price then --This means that the ''Money'' Variable is higher or equal to Price.
Money = Money-Price --This will set the Money variable to what it is after the price is substracted from it!
print("Bought")
print("Money Left :") --Basically just prints stuff
print(Money)
else
print("Not enough money!")
end
I am loving how these tutorials are so easy to understand!
i would recommend you to play around with what you learn in each episode to learn some things that TheDevKing didn't show us, or didn't show us yet! :D
you can also print the money left in the same line with .. or , for ex
local m = 9
local price = 1
print("Item price " .. price) -- YOU HAD TO PUT SPACE HERE
print("Money", m) -- no space
In my opinion, ',' is better.
Now i feel like most food u like is hotdogs u basically use in every video till now 😂😂😂
I still understood this without watching. Great tutorial!
I watched all tutorials and i feel like a professional developer! Your videos really help they are so simple to understand ur the best teacher?
No other TH-camr:
TheDevKing: 1 dislike lets gooo
2
3
*local* disslikes = "The people who just accidentally pressed the disslike button"
4!
4
me bingewatching your vids and taking down notes like crazy be like: I WILL DO THIS CUZ THEDEVKING IS GIVING ME PERFECTO INSTRUCTIONS
Did anyone else see an ad by Sakpot insulting Lua using this exact video and clip at 3:43 ?
Ohh yeah, it was an ad on that GameMaker thing saying if we'ere tired of Junky game makers even though roblox is actually really good and was using a literall tutorial to say roblox is a junky game engine even though its actually really good!
I dont get it anymore...
How would i make it more than one number for example if the money is any number under zero, a part turns red, and then if the money is above 0 the part turns green
yandere dev learning this:
local yandere=7
if yandere=1 then
print ("oh no")
elseif yandere=2 then
print ("oh no, try again")
elseif yandere=3 then
print ("oh no, try again still")
elseif yandere=4 then
print ("ugh stop it")
elseif yandere=5 then
print (":C")
elseif yandere=6 then
print (">:C STOP")
elseif yandere=7 then
print ("finally I got it!")
elseif yandere=8 then
print ("WHAT ?!? TURN AROUND")
elseif yandere=9 then
print ("GO BACK!!!")
elseif yandere=10 then
print ("STOP THIS NOWW")
end
after watching 6 years later these lessons still simple and understandable
Bro should get hired by Roblox
after 2:25 seconds i understood how a run (on button) script works. Thank you ;)
Güzel video az ingilizceyle bide alt yazı ile anlayabildim teşekürler
and now i just made a somewhat big script from scratch and this one worked, it used a lot of if and functions, it printed "they equal 8"
I think I finally get it! An else statement means hotdogs 🤔
How do you put an if statement inside a function
So if i wanted to make a level up game and you needed a level requirement and every time they try to accept a quest if they aren’t the required level i could use this? to show a gui that popes up everytime you try to accept the quest? just asking for better understanding thanks!
hey i got a question is it compulsory to add the elseif statement or you could separate else and if
Script is so fun!
It’s like a Math version 2
oh god this is reminding me about my javascript experience
Here is an example you can use else and if statement-
Suppose a weapon cost 100 and you only have 70 and you try to buy it, you want to make it so that a error comes saying 'not enough money', here you can use else and if statement by simply putting else 'Not enough money'.
U DESERVE MORE SUBS and i loved the vid im about to finish the serie
Thank you for teaching me if statements! I like these tutorials!
Short video with lots of easy to understand and valuable information, your amazing!
Everytime I watch one of these videos I crave Hotdogs..
Idr like hotdogs
This is great thanks alot man!
This man helps me learn every single video
Your such a good youtuber your like to dislike ratio are in such a good difference which shows youare really good
Can we all just appreciate how he puts his hotdog on our scripts?
What is the 'if statements' series called? Like what is the proper name for it?
to check if something is not equal to something (opposite of ==) type: ~= Hope that helps
5 years ago..
ur my favourite roblox studio youtuber now
The Dev King is the elseif statement even useful?
It can be used for gamepasees
If player have gamepass then give speed boost
else
dont give speed boost
it can?
me from not understanding local to me scripting like a pro thanks bro ur series helped alot
4:57 what was that sound?
Thanks you
Thank you for watching :D
This is helpful for others so i hit the sub
the only problem is, i understand everything your saying but i have no idea what these would be used for in a game yk
Fr
"Hotdogs" can be anything honestly and the print is to just check if something is true or not
@@Twilyytwinkle i know but like what would you use it for, like when you're making a game
@@hiro3667 like I said it can be used for anything, rn I can't think of an example sorry but it is really useful for beginners. He is teaching else and elseif, and the others are just examples to use else and elseif, it's more understandable when you're actually scripting.
@@hiro3667 it works for errors and MANY other ways
Thank you :-) I have a rough idea on why you would want to do multiple condition checks
Tysm this was easy for me to learn keep up with the good work!
Hotdogs for life. Gotta agree lol. TheDevKing likes hotdogs a lot XD
scripting is so fricking cool i learned alot in this vid
*'if hotdogs wouldnt run'*
makes sence
Somehow, I have watched every scripting tutorial up til this one and haven’t gotten confused even once.
I understood at 2:16 minutes, this guy is a god... I mean a professional master lord of scripting... and god created him lol
So what is the point of an elseif statement?
just another if statement when if statement get else yeah
Hi all - I am relatively new to this, is it possible to compare block colors in IF statements.
e.g if 1 block color == really red then change the transparency of another block?
This was very simple tap! :)
Even to this day, your videos are inspiring!
i dont get why the print is important because it doesnt really effect the actual game.
I ain’t smart but it helps to debug a game
Do you need a else statement at the end or can you just use elseif statements in the if?
dislikes are from the script kids who cannot learned how to script
Wait ima script kid and i can learn how to script and liked. Lol
hey @TheDevKing is this video tutorial also used for randomizers?
Hmm. I believe one of the later ones has a tutorial on that
It's easy for me to understand because I know PHP. Great tutorials!.
Thank you for ur simple tutorial, I really like it
Checkpoint: 3:19
Will i be able to make an animated opening & closing door at the end of this tutorial? I mean do you teach it?
my dude is insane legit i just watched 2 video's and i get this one easy,
Breaking news, hot dogs isn’t equal to 3. This is an absolute tragedy for mankind however it may mean TheDevKing won’t eat 5 hotdogs every tutorial. This is good, unless if he really likes hotdogs, which is true because he has made hotdog variables equal to awesome I believe.
oh man
Local TheDevKing == "Hotdog"
if TheDevKing = "Hotdog" then
print ("SHEESSHHHH")
--This is an amazing script.