Beginner's Roblox Scripting Tutorial #15 - Breaks / Loop Breaking (Beginner to Pro 2019)

  Рет қаралды 150,971

TheDevKing

TheDevKing

Күн бұрын

Пікірлер: 455
@TheDevKing
@TheDevKing 5 жыл бұрын
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
@maryberova3945
@maryberova3945 3 жыл бұрын
hi
@Jimmyah2273
@Jimmyah2273 3 жыл бұрын
hmm, the link doesnt work for me
@l4z3r92
@l4z3r92 3 жыл бұрын
weird when i tried to do the rain script again it doesn't work it says that when i put rain.size or anything like that it doesnt work
@oggaraggairoaawfauhaiu31_UN
@oggaraggairoaawfauhaiu31_UN 2 жыл бұрын
excuse me, when i put the script inside while true do it works, but whenever i put any script outside of it, instead of spawning lots of rain, it just puts a floating rain block that slowly floats down and teleports back to the top when close to touching the floor, and it spins alot.
@mwafr
@mwafr 2 жыл бұрын
@@oggaraggairoaawfauhaiu31_UN comedy
@hook5995
@hook5995 2 жыл бұрын
Some better explanation on rainspawned = rainspawned + 1 what's happenign here is that the loop is taking both the variable itself AND the number that "rainspawned" is talking about. Let's say there's 7 rain. This means when you write "rainspawned", it runs and sees "oh that's 7". So when you type "rainspawned = rainspawned + 1" It sees "The variable rainspawned is equal to 7 + 1" thus you get 8, which it runs again and then makes it 8 + 1 so 9, and so on.
@BABAPLAYTOOMUCH
@BABAPLAYTOOMUCH 2 жыл бұрын
Ty for this!
@jeremyarchive111
@jeremyarchive111 Жыл бұрын
Thank you, made a lot of sense!
@nahunknown19
@nahunknown19 8 ай бұрын
@@jeremyarchive111 how you doin its been one year
@GoldDaPhiny
@GoldDaPhiny 6 ай бұрын
so basically it adds 1
@DaMonkeVrGmod2024
@DaMonkeVrGmod2024 6 ай бұрын
Thanks!
@fridaee
@fridaee 3 жыл бұрын
I always thought scripting was hard but with your teaching it's very easy and fun!
@hnxyziz
@hnxyziz 2 жыл бұрын
ong
@domstaydolo3351
@domstaydolo3351 Жыл бұрын
@@hnxyziz fr
@zaidqureshi5742
@zaidqureshi5742 Жыл бұрын
and his tutorials are smaller than the other youtubers
@domstaydolo3351
@domstaydolo3351 Жыл бұрын
@@zaidqureshi5742 fr
@terrybrawlstarsaddict
@terrybrawlstarsaddict Жыл бұрын
same
@AvarageMilkEnjoyer
@AvarageMilkEnjoyer 3 жыл бұрын
When you see you almost completed the Beginner course and almost can move on to the advanced course 👀
@yxngjace
@yxngjace 3 жыл бұрын
Yup I’m excited
@akeem3988
@akeem3988 3 жыл бұрын
@@yxngjace same
@tekof4358
@tekof4358 3 жыл бұрын
so guys how did it go so far? did you make your game or your still developing?
@yxngjace
@yxngjace 3 жыл бұрын
I quit I mean I ain’t proud of it but I did
@tekof4358
@tekof4358 3 жыл бұрын
@@yxngjace NOOOOO WHYY?? ITS STILL NOT TO LATE YOU CAN STILL GET BACK!
@Bazzar_Studios
@Bazzar_Studios Ай бұрын
I followed the script and then added some of my own code to make the code easily adjustable through some basic global variables. I used to have no idea how to code know i would call my self intermediate thank to your amazing videos.
@mexicanfloppa
@mexicanfloppa 2 ай бұрын
i always thought scripting was hard but with your teaching its fun because when i do the tutorial i dont have to make a full fledged game in my first tut
@eioboino9369
@eioboino9369 3 ай бұрын
me and my friend decided to make a game an anime battlegrounds game and your videos inspired me like ive never been inspired like this before THX tapwater :D
@Planteron1
@Planteron1 2 жыл бұрын
The crazy part was that I was using what I learned from the last videos, to make it where when I hit the block it would spawn another one that kills me. But it was infinite so then I came here and guess what it helped me stop the loop!
@ElBoboduro
@ElBoboduro 23 күн бұрын
yk man, this is so much simpler than i thought. Though I haven't yet watched your vid about server - client communication - which is what I'm most scared for lol. I learnt Java in school so I'm familiar with OOP, so I'm literally watching all your videos in one sitting thinking I can script most front page games (once i learn client vs server of course). Thank you for this godly content.
@curlsroblox9712
@curlsroblox9712 4 жыл бұрын
If you didn’t know, you can change a parts color with scripts! Here is a script that I made on how to make a part change colours: while true do script.Parent.BrickColor = BrickColor.Random() wait(1) end
@Catchity
@Catchity 4 жыл бұрын
This is basic
@MichaelR1275
@MichaelR1275 4 жыл бұрын
@@Catchity I'm the Gingerbread man!
@Catchity
@Catchity 4 жыл бұрын
@@MichaelR1275 Wdym
@MichaelR1275
@MichaelR1275 4 жыл бұрын
@@Catchity Your name. Add it to my sentence
@MichaelR1275
@MichaelR1275 4 жыл бұрын
@@Catchity Get it yet?
@Levi-xx1mj
@Levi-xx1mj 4 жыл бұрын
You are the best youtuber for learning to code. 100/10. Would recommend.
@eyurDes
@eyurDes 5 ай бұрын
from a guy who didnt know the print script or variables i now can make a game which wont be that trash thx this is teaching script other vids are showing and your teaching
@kageman
@kageman 5 жыл бұрын
YAYYYY HES POSTING STILL
@guestlsc0ol
@guestlsc0ol 3 ай бұрын
yayayayayaya hes still posting ( lol this comment im commenting on is 4 years ago )
@SPYARMYFFFF
@SPYARMYFFFF Ай бұрын
​@@guestlsc0ol 5 year*
@mattyaz5850
@mattyaz5850 2 жыл бұрын
Tysm man currently my 3rd time watching and learning all the basics I have most of em in mind already. This video was nice and simple and I won't stop scripting ty :)
@mano8057
@mano8057 Жыл бұрын
its been 7 months since you wrote this, how has scripting been?
@detcom9140
@detcom9140 Жыл бұрын
@@mano8057 how’s yours been?
@mano8057
@mano8057 Жыл бұрын
@@detcom9140 Honestly, I learned alot. But as it stands right now I'm working on learning languages and fictional stories. Devving is all about how much motivation you have, there's no chance you won't learn to script unless you don't want to, which was my case. Also I suggest you read the roblox dev wiki to learn to script, 10x faster and little to no devs actually learned from videos
@sickGearStudios
@sickGearStudios Ай бұрын
@@mano8057 its been one year how has it been now lol
@SPYARMYFFFF
@SPYARMYFFFF Ай бұрын
​@UltraCodedZero its been 2 weeks how it been now
@lamedev1342
@lamedev1342 5 жыл бұрын
Almost at 1000 subscribers congratulations! I'm gonna watch every advertisement if you monetize cuz you deserve it man!
@codinggemgaming1968
@codinggemgaming1968 3 жыл бұрын
OMG THIS TUTORIAL LITERALLY HELPED ME MOVING WALL PROJECT
@DatToxicGuy
@DatToxicGuy Жыл бұрын
Really good tutorial! Can't wait for the advanced version! :D
@Blackilykat
@Blackilykat 4 жыл бұрын
I made a rain that stops when it reachs 500 rain drops: local value = 1 while true do wait() value = value + 1 local TestPart = Instance.new("Part", game.Workspace) TestPart.Anchored = false TestPart.Size = Vector3.new(0.5,2,0.5) TestPart.Position = Vector3.new(0,30,0) TestPart.CanCollide = false TestPart.Transparency = 0.5 TestPart.BrickColor = BrickColor.new("Really blue") print(value) if value == 500 then break end end Is this good?
@TheDevKing
@TheDevKing 4 жыл бұрын
nice! :D
@Blackilykat
@Blackilykat 4 жыл бұрын
Noob says Codes ur welcome 😊
@xeistan7793
@xeistan7793 4 жыл бұрын
use debounces for cooldowns: local debounce = false if debounce == false then debounce = true - this is not false so it wont run again -- do stuff wait(5) - the cooldown time debounce = false - allows script to run again
@xeistan7793
@xeistan7793 4 жыл бұрын
CyanRBLX did you learn grammar at school 3 years ago too?
@tajinderkaursyal1312
@tajinderkaursyal1312 4 жыл бұрын
Thank you, you saved my computer from getting smashed, I had been trying it for 2 hours.
@JellybeanSTUDIOS
@JellybeanSTUDIOS 3 жыл бұрын
As the great Super Mario has said "Just what I needed!"
@bbldrake6651
@bbldrake6651 5 жыл бұрын
Dev Kiing are we getting a discord channel for your channel soon
@TheDevKing
@TheDevKing 5 жыл бұрын
That's a GREAT IDEA! Writing that down and I'm going to be making it soon. Thank you!
@bbldrake6651
@bbldrake6651 5 жыл бұрын
@@TheDevKing you are welcome
@TheDevKing
@TheDevKing 5 жыл бұрын
discord.gg/FKcSyRh I MADE IT!
@IX_4
@IX_4 3 жыл бұрын
@@TheDevKing yay
@dreagerd8248
@dreagerd8248 3 жыл бұрын
i recommend making a part on the whole map and if the rain hits it it gets destroyed, this is to prevent lag and with that u can make infinite rain.
@levoca-9296
@levoca-9296 3 жыл бұрын
I would do something like wait(2) Workspace.Part:Destroy()
@ThawBerry
@ThawBerry 2 жыл бұрын
I just did rain.CanCollide = false
@detcom9140
@detcom9140 Жыл бұрын
Rain.Touched:Connect(function) Rain:Destroy()
@efec4488
@efec4488 Жыл бұрын
nah just use particles
@amiroto8449
@amiroto8449 Ай бұрын
@@ThawBerry that is bad because it would cause lag, it will go through the baseplate and even though you wont see it it will cause lag
@somefigure
@somefigure 3 жыл бұрын
if you don't know instead of writing variable = variable + 1 you can write it a shorter easier way like this variable += 1
@lukediscord4166
@lukediscord4166 2 жыл бұрын
Man i love these tutorials
@bettheelite3423
@bettheelite3423 2 жыл бұрын
ur helping me soo much to learn scripting, and i will be sad if i not liked one of ur tutorials. soo hope ur doing well my guy and continue the good work!
@amogusamogus8164
@amogusamogus8164 2 ай бұрын
Its been exactly 5 years that this video got uploaded
@mrshadow5132
@mrshadow5132 3 жыл бұрын
Thank you Dev King, i learning alot with your vids!
@fraserglasgow5735
@fraserglasgow5735 4 жыл бұрын
rains on and off: feel free to play with the numbers (note:rain will spawn in the middle) while true do wait(5) -- the amount of time until the next batch of rain local RainTime = 0 while true do if RainTime >= 50 then --the number is how long you want it to rain for break end RainTime = RainTime + 1 wait(0.1) local NewPart = Instance.new("Part", game.Workspace) NewPart.Position = Vector3.new(0,20,0) NewPart.Size = Vector3.new(0.25,1,0.25) NewPart.Color = Color3.fromRGB(50,50,200) NewPart.Transparency = 0.7 NewPart.Anchored = false NewPart.Touched:Connect(function() NewPart:Destroy() print("rain was removed") end) end print("the rain has ceased") end
@TheFakePlayerGame
@TheFakePlayerGame 3 жыл бұрын
I’d say make rain spawn 500 studs above you and random place, then make it so that when touched ground it despawns. Also make reflectance 1 and it will look like Rain :0
@densylek8779
@densylek8779 2 жыл бұрын
you should use random math for pos so xyz values are different
@rileybaxter6634
@rileybaxter6634 2 жыл бұрын
i like the idea of the rain getting removed when it hits the ground
@Hesxle
@Hesxle Ай бұрын
Thanksss u are the best u helped me a lot i love ur tutorials ❤❤❤
@sebs31
@sebs31 Ай бұрын
this is like school but very fun :D
@baconmasterr
@baconmasterr 3 ай бұрын
Woo hoo! i made it to tutorial 15
@wernkaros7517
@wernkaros7517 3 жыл бұрын
I LOVE YOU TDK YOUR THE BEST!.YOu have helped me soo much now i am kind of a pro scripter.I help people when they have problems,i dont know what to say.I love you mann tysm
@azillystudios
@azillystudios Жыл бұрын
Thank you so much. I had a game-breaking bug in my game, and this fixed it completely.
@whey1444
@whey1444 3 жыл бұрын
U could also use repeat until like this: local rainspawn = 0 repeat rainspawn = rainspawn + 1 wait() local rain = Instance.new("Part", game.Workspace) rain.Size = Vector3.new(.5,2,.5) rain.Anchored = false rain.Position = Vector3.new(1,100,1) rain.Transparency = .5 until rainspawn >= 250
@overseer_the_engineer
@overseer_the_engineer 2 жыл бұрын
So you just created a inf loop BC you didn't put brake
@whey1444
@whey1444 2 жыл бұрын
Not infinite since the * until rainspawn >= 250 * but it works the same as the video's method with break
@anrovlogs2834
@anrovlogs2834 5 жыл бұрын
Finally TheDevking here again i hope you read this comment. Plss make a Keybind tutorial. Subscribed liked 😍
@CoolAnimation-ld6jr
@CoolAnimation-ld6jr Жыл бұрын
btw instead of raincount = raincount + 1 you could just do raincount += raincount
@khy8
@khy8 4 жыл бұрын
it's way easier to do repeat until
@javierplayz
@javierplayz 3 жыл бұрын
yep
@takahashikakeru6963
@takahashikakeru6963 3 жыл бұрын
i prefer while true do
@techxgamingk2197
@techxgamingk2197 3 жыл бұрын
ngl but no, its used more in advanced roblox lua, so the method ur using is fine until teh advanced parts
@Ilba8765
@Ilba8765 5 жыл бұрын
Nice tutorial. Keep it up.
@33kc.
@33kc. 10 ай бұрын
Some better explanation on rainspawned = rainspawned + 1 so here youre asking the script to add +1 to the original rainspawned value, so for every part dropped the scripts understands it as, ok so for example 10 parts of rain dropped, the scripts understands this in such a way that every part dropped gets added to "10" so it stops at a certain amount (added to the variable)
@dragonflee4763
@dragonflee4763 2 жыл бұрын
Automatic sculpture maker lol with the rain thingy local rainspawned = 0 while true do if rainspawned >= 200 then break end rainspawned = rainspawned + 1 wait() local Rain = Instance.new("Part",game.Workspace) Rain.Position = Vector3.new(0,30,0) Rain.Size = Vector3.new(0.5,2,0.5) Rain.Anchored = false Rain.Transparency = 0.5 Rain.CanCollide = true Rain.Touched:Connect(function() wait(0.5) Rain.Anchored = true end) end
@riskygadget4life
@riskygadget4life 11 ай бұрын
Nah this is fun the rain is crazy hecks yooo
@lol_gfk9690
@lol_gfk9690 Жыл бұрын
This is where the real fun start
@MisterIsmail395
@MisterIsmail395 Ай бұрын
Thank you man i also subbed
@keinee2207
@keinee2207 4 жыл бұрын
I made my own script OMG i am so happy i slightly understand scripting now from Scripting Tutorial #1 to #15. If you touched the part of the rain you will die. local raindropped = 0 while true do if raindropped >= 1000 then break end raindropped = raindropped +1 wait() local Rain = Instance.new("Part",game.Workspace) Rain.Position = Vector3.new(0,500,5) Rain.Size = Vector3.new(1,1,1) Rain.Material = "Glass" Rain.Transparency = 0.50 Rain.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Humanoid.Health = 0 end end) end
@havoccrenshaw3416
@havoccrenshaw3416 4 жыл бұрын
you'd die on your screen, it's clientside not serverside, go check out his filtering enabled videos talking about how to fix that if you haven't already
@stopfollowingme1261
@stopfollowingme1261 4 жыл бұрын
I don’t think it has that problem
@stopfollowingme1261
@stopfollowingme1261 4 жыл бұрын
I just tested it and it was seen by the server too
@fructosepear9868
@fructosepear9868 3 жыл бұрын
:D same lol i made it random cuz i watched the next vid :p
@MrChaoticCrazed
@MrChaoticCrazed 3 жыл бұрын
you can also use the function Takedamage(Number Here) so everytime the rain hits the player, they take that amount of damage such as Rain.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Humanoid:TakeDamage(5) end
@dudewtf836
@dudewtf836 4 жыл бұрын
thanks TheDevKing from this i made own lag test game thx so much you deserve much more subs.
@Selatapey
@Selatapey Жыл бұрын
Instead of doing the if statement, you could also just write “while rainspawned
@llGaIaxyll
@llGaIaxyll 3 жыл бұрын
413 he say he don't know how to explain I understand so basically it means that rainspawned variable is 0 then it was rainspawned = rainspawned+1 it means that every second it is adding 1 to rain
@0_onenottwo
@0_onenottwo 3 жыл бұрын
You probably don't need a break in the loop, you can just use a repeat. Make it so it repeats adding to the value each time until it reaches the goal value.
@rudyranger249
@rudyranger249 2 жыл бұрын
im 1 year late, you can also just do "while (variable) < 50 do" but yeah he was just teaching how break works.
@0_onenottwo
@0_onenottwo 2 жыл бұрын
@@rudyranger249 I forgot I commented that lol
@615ef56a
@615ef56a Жыл бұрын
@@0_onenottwonot sure if any of you explioit but i was wondering how to create it so i don't need the
@Azure546
@Azure546 Жыл бұрын
@@615ef56a but im pretty sure u cant do it without
@fortfight536
@fortfight536 2 жыл бұрын
Thx bro it helped me a lot!
@unknown-qm7qi
@unknown-qm7qi 2 жыл бұрын
I’m watching all the serie!, Its so cool i learned much It is awesome can u continue it and do roblox script pro?
@liangmeng5952
@liangmeng5952 8 ай бұрын
you can also do repeat wait() [function for raining] until [amount of rain variable] == [amount of rain to be rained] which ones better to use? or prefered?
@NexuBlox
@NexuBlox 5 ай бұрын
To me Both its Usefull :D
@Kelv161
@Kelv161 3 жыл бұрын
Oh man, you are right, i should take a BREAK after watching all of those 14 videos
@matthewnelson3763
@matthewnelson3763 4 жыл бұрын
So to break it you have to have an if statement and in the if statement you have to tell it when to stop?
@shrena3179
@shrena3179 3 жыл бұрын
You are the King bro
@naelfg8194
@naelfg8194 2 жыл бұрын
Hello, i'm Naël, i'm french and i love your vidéos !
@MrWoofWoof03Streams
@MrWoofWoof03Streams Ай бұрын
note what he means is rainspawn = 0 rainspawn = rainspawn + 1 what this basically means is that rainswawn = 0 + 1 after that passes rainspawn = 1 and so on
@teleportationglitch7617
@teleportationglitch7617 2 жыл бұрын
you are soo helpful when i started i didn't know what i was doing lol
@bruhmate7195
@bruhmate7195 4 жыл бұрын
I tried turning player collision off by using Rain.PlayerCollision = false so it would be like real rain but it didnt wanna work otherwise everything that you taught is going AMAZING! :D
@lobsterman8787
@lobsterman8787 4 жыл бұрын
do rain.cancollide = false instead
@ShranauvYT
@ShranauvYT Жыл бұрын
its Rain.CanCollide = false but it offs collision for every part in the game
@robotbanana4261
@robotbanana4261 3 жыл бұрын
If you’re somehow still confused about variable = variable + 1 It’s taking whatever the current value of the variable and adding one. This will make it increase in value by 1 every time the code is ran.
@Gadavious101
@Gadavious101 3 жыл бұрын
it justs adds one to the current value
@robotbanana4261
@robotbanana4261 3 жыл бұрын
@@Gadavious101 that’s what I said.
@ImaDonutDev
@ImaDonutDev Жыл бұрын
what?? this is not related with this video and everyone knew that
@sab1r.937
@sab1r.937 Жыл бұрын
@@ImaDonutDev how is it not related to the video
@29dGD
@29dGD Жыл бұрын
thanks man finally i know what the break meanss!
@Potato_Pizzer
@Potato_Pizzer 3 жыл бұрын
Ok, these tutorials or like gold, they work its easy I'm telling you, GOLD
@JaymcJefty
@JaymcJefty 3 ай бұрын
Then there like silver because silver is the best conductor of electricity
@javierplayz
@javierplayz 3 жыл бұрын
hello this might be the most advanced, working script i've ever done local rainspawned = 0 while true do if rainspawned >= 300 then break end rainspawned = rainspawned + 1 local rainPart = Instance.new("Part", game.Workspace) rainPart.Position = Vector3.new(56,30,0) rainPart.Size = Vector3.new(0.2, 1, 0.2) rainPart.Anchored = false rainPart.CanCollide = false wait(.3) if rainspawned >= 200 then wait(.4) end if rainspawned >= 100 then wait(.7) end end
@Gadavious101
@Gadavious101 3 жыл бұрын
You can make it shorter
@somerandomdude9712
@somerandomdude9712 3 жыл бұрын
You can also use debris to make the ran disappear after a couple seconds.
@nahunknown19
@nahunknown19 8 ай бұрын
how you doing its been 2 years
@somerandomdude9712
@somerandomdude9712 8 ай бұрын
@@nahunknown19 alright, i dont script no more tho
@nahunknown19
@nahunknown19 8 ай бұрын
Emotionnal deception (why everyone quit another guy said that he quit)@@somerandomdude9712
@somerandomdude9712
@somerandomdude9712 8 ай бұрын
@@nahunknown19idk I just got bored of it, I was 13 when I made this comment now I’m turning 16 in a month, so it was just a thing for me from when I was in middle school. Also I got other things to do now.
@musembifamily1318
@musembifamily1318 9 ай бұрын
ok so if you dont understand while is a loop and if rainspawned = rainspawned + 1 and if its a loop what will it do think rainspawn was 0 and if its rainspawn+1 that becomes 1 and if rain spawn plus 1 again bc its a loop it will be 2 now see the rain goes on till the rain spawn counts to 50 it doesnt have anything to do with the local rain = instance.new it just a timer which counts down to 50 then it breaks everthing incoulding the rain the whole while loop it breaks it have any questions ask
@demIsWashedLMFAO
@demIsWashedLMFAO 7 ай бұрын
you can also do : local RainVariable = 1 repeat wait() local Rain = Instance.new("Part", game.Workspace) Rain.Position = Vector3.new(0, 15, 0) Rain.Size = Vector3.new(0.5, 2, 0.5) Rain.Anchored = false Rain.Transparency = 0.5 RainVariable4= RainVariable + 1 until RainVariable == 50 end
@amateur631
@amateur631 2 жыл бұрын
for the rain you can just remove cancollide
@Muh594
@Muh594 9 ай бұрын
if you guys dont know what this rainspawn = rainspawn + 1 mean, the meaning is that everytime a part in that while do will add 1 to rainspawn variable (If im wrong correct me in the comment)
@whatskpoppingg
@whatskpoppingg 2 жыл бұрын
broo i understand it now tysm
@baconhair2879
@baconhair2879 4 жыл бұрын
But how to make it loop again? Please answer, thank you
@jerse1245
@jerse1245 4 жыл бұрын
Functions
@collectiveworld5047
@collectiveworld5047 3 жыл бұрын
You will make a wait, then paste the script again.
@YellowPeace
@YellowPeace 3 жыл бұрын
Is there a way to make the loop run again when there are less objects then the amount that you put in? (like when they despawn or I pick them up)
@person8316
@person8316 4 жыл бұрын
Funny lil script I made :) local words = 0 script.Parent.Touched:Connect(function(player) local hum = player.Parent:FindFirstChild("Humanoid") while true do wait(1) print("hi") words = words + 1 hum.Health = hum.Health - 1 if hum.Health == 10 or words == 100 then break end end end)
@aloo4572
@aloo4572 4 жыл бұрын
This'd just kill the player wouldn't it??
@abandonedddreamstation
@abandonedddreamstation Ай бұрын
@@aloo4572 yeah
@zz3pter
@zz3pter Жыл бұрын
I quit Roblox Studio and I'm back now, it's revision time *sigh*
@النجوم-ذ5ص
@النجوم-ذ5ص Жыл бұрын
Same
@batameez_pasta1809
@batameez_pasta1809 4 жыл бұрын
How do you teleport a part to a player and it stays on the player? To have a sign that the rain has stopped.
@yaz3876
@yaz3876 3 жыл бұрын
Amazing!
@showiestsugar74gaming42
@showiestsugar74gaming42 Ай бұрын
There's a shortcut for: rainspawned = rainspawned + 1 shortcut: rainspawned += 1 (btw im a pygame developer for 4 months)
@mangaartistshamz8816
@mangaartistshamz8816 4 жыл бұрын
Wait, can't you just use wait()???
@s2cfake
@s2cfake 4 жыл бұрын
can't you just use repeat until? cool though I'm a scripter but i never knew what break did
@Stickman_Productions
@Stickman_Productions 3 жыл бұрын
I made a game where you have to survive big falling bricks and if you touch them you die. You have to go under a shelter that moves to different places of the map after a minute or two.
@daky5169
@daky5169 5 жыл бұрын
oh yes hes back
@taqwagroomingcenter3122
@taqwagroomingcenter3122 2 ай бұрын
tbh when he said to stop the rain i knew what he was going to do in his like past ones he made this while Hotdogs < 5 do tihs mean it will go forever but then he did Hotdogs = Hotdogs + 1 which made it stop at 5
@youknowtruthless9067
@youknowtruthless9067 4 жыл бұрын
Guys! If your game laggs and you want the rain to keep going then do: while true do wait() local Rain = Instance.new("Part", game.Workspace) Rain.Size = Vector3.new(0.5,2,0.5) Rain.Position = Vector3.new(0,15,0) Rain.Transparency = 0.5 Rain.Anchored = false Rain.CanCollide = false end print("The Loop is Finished!")
@beepbeepimasheep237beepbee3
@beepbeepimasheep237beepbee3 4 жыл бұрын
wait() is important.
@UntitledJim
@UntitledJim 3 жыл бұрын
just make sure Rain.CanCollide is false so it falls through the baseplate and you wont have any lag
@sdewwu
@sdewwu 3 жыл бұрын
for anyone whose iq is less than average, "CanCollide = false" makes it so the parts (rain) fall through the baseplate and they disappear once its low/deep enough, making it pretty much so it can only contain like a few hundred parts because it's adding and removing them at the same time
@jasminadan2266
@jasminadan2266 3 жыл бұрын
@@sdewwu The audience ur comment is directed to wudnt have gotten this far in the first place. Plus, a lot of ppl with average iq didn’t even know that before u ATTACKED them. It’s called the “fall height destroy” property if anyone was wondering.
@sdewwu
@sdewwu 3 жыл бұрын
@@jasminadan2266 how did i attack anyone? lmfao soft much
@shiko_real
@shiko_real 3 жыл бұрын
It has been almost a year since ive seen this and this is the first time im using this
@kelk_One
@kelk_One 5 ай бұрын
❤Love from France
@disater12disater
@disater12disater 2 ай бұрын
Its saying that the "break" shouldnt be there because it should apparently be in a loop when it already is in a loop, can anyone help me?
@homeblox9743
@homeblox9743 Жыл бұрын
Forgetting to type in wait has to be one of the most punishing mistakes
@raidyqk
@raidyqk Жыл бұрын
I would recommend everyone reading instead of "while" loops to opt for "repeat" loops. Code example for what he did: local rainspawned = 0 repeat rainspawned += 1 --You can also use rainspawned = rainspawned + 1, but as a programmer you are lazy so this is how to save most characters wait(1) local rain = Instance.new("Part") rain.Size = Vector3.new(0.5, 2, 0.5) rain.Position = Vector3.new(0, 15, 0) rain.Transparency = 0.5 rain.anchored = false rain.Parent = game.Workspace --Due to performance issued many scripters opt to name the parent later in the script until rainspawned >= 50 --Use a condition which will never be false if u want to make an infinite loop, but I would recommend using a while loop in that case
@CAUKAIETS
@CAUKAIETS 3 жыл бұрын
cant you do this as well? local piens = 1 while piens < 50 do wait (0.05) local zeme = Instance.new("Part", game.Workspace) zeme.Position =Vector3.new(-20, 295.5, -70) zeme.Transparency = 0.5 zeme.Size = Vector3.new(0.5,2,0.5) piens = piens + 1 print(piens) end
@liness1152
@liness1152 3 жыл бұрын
Another way to make this easier is you can just do: while True do Local Melon = Instance.new("Part",game.workspace) Melon.Size = Vector3.new(0.1,0.2,0.1) Melon.Position = Vector3.new(0,100,0) Melon.Color = Color3.new(170,0,0) Melon.CanCollide = false Melon.Transparency = 0.3 Melon.Anchored = false wait() end I made this after watching most of your tutorials and it's like this but it breaks without using the breaking code but I'm going to use this more often :) thank's for your help this the most understanding amount of tutorial's I've ever watched and me and my team should be coming out with a game very soon. The name of it will be "Escape the School Obby" and it is it supposed to be better than the best one in that category when you search it, it looks amazing right now! -Head Dev at SuPreme Production's
@mexicanfloppa
@mexicanfloppa 2 ай бұрын
bro spent a minute waffling after "peace out"
@sacred5492
@sacred5492 3 ай бұрын
4:53 how does it know that the variable rainspawned is referring to the amount of the rain that has spawned without you telling it?
@MidnightStorm4990
@MidnightStorm4990 3 жыл бұрын
Here is my script: rain = 0 while true do if rain
@donparahyba
@donparahyba 3 ай бұрын
remembering people here that you could do rainspawned += 1 it's the same thing as "rainspawned = rainspawned + 1" but you type faster (Don't use it in lua scripts outside roblox, as it doesn't support it!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
@Kevin-wt9lz
@Kevin-wt9lz 2 жыл бұрын
I actually suggest doing normal lua before roblox lua lol but I did roblox lua first, normal lua and just roblox Lua.
@MieysoFelix
@MieysoFelix 2 жыл бұрын
instead of "Rainspawned = Rainspawned + 1" you can do:" Rainspawned += 1"! (Rainspawned sadly doesn't work) i know it beacause i normally code in C++ or in C# and Lua is C-based
@oogaboogaboogabooga1497
@oogaboogaboogabooga1497 2 жыл бұрын
When it says 'Rainspeed = Rainspeed + 1 could you possibly make that shorter and do *Rainspeed++ ?
@spider7566
@spider7566 2 жыл бұрын
I know it's really really late and you probably already figured it out but if you want to give more than 1, instead of doing rainspeed = rainspeed + 1 you can do rainspeed = rainspeed + 2 or any other number you want, you can put decimals in the numbers like 1.5 and even do less than 1 like .5 (if there is a . first it means there is a 0 before the . [0.5])
@thinkforname6098
@thinkforname6098 4 жыл бұрын
How to do that but with a custom brick?
@technoindex1022
@technoindex1022 2 жыл бұрын
When we were making the break script i guessed we were using a if statement for the break.
@hrg384
@hrg384 3 жыл бұрын
scripting got too easy because of this guy
@quicstab1367
@quicstab1367 3 жыл бұрын
this looks dope just color it in using brick color, im too lazy to adjust it/ local rainspawn = 0 while true do if rainspawn >= 100 then break end rainspawn = rainspawn + 1 local Rain = Instance.new("Part", game.Workspace) wait() Rain.Transparency = 0.5 Rain.Anchored = false Rain.CanCollide = true Rain.Position = Vector3.new(-83.523, 24.096, 176.243) Rain.Size = Vector3.new(3.053, 0.547, 0.413) end print ("Finished")
@FaintedHeart
@FaintedHeart 3 жыл бұрын
it took me 30 minutes trying to figure out how to do this, and that was all i had to do
@rxblo
@rxblo Жыл бұрын
I know this video was uploaded 3 years ago, and it is probably dumb to ask for doubt clarification now but if someone can help, that'd be greatly appreciated. So, instead of breaking the loop using an if statement, why not directly do: while RainSpawned < 10 do - - code end Im curious as to when we cant do that and loop breaking comes in handy.
@felix_abm
@felix_abm 10 ай бұрын
finally, a comment that actually says something about this. all I saw in the comment section are just people asking why their codes didn’t work. it’s nice to actually see people who have an iq higher than 20
小天使和小丑太会演了!#小丑#天使#家庭#搞笑
00:25
家庭搞笑日记
Рет қаралды 36 МЛН
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 1,6 МЛН
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 57 МЛН
Spending Robux for the Strongest BEYBLADES in Roblox
15:12
Koopekool
Рет қаралды 1,1 МЛН
I Learned How to SCRIPT in 7 Days | Roblox
11:00
Simjet
Рет қаралды 108 М.
Returning Functions and Breaking Loops - Learn To Script #5.5
9:10
I Scripted Your Funny Roblox Ideas.. (Part 13)
6:37
TheDevKing
Рет қаралды 3,3 МЛН
The Story of The BIGGEST Roblox Hackers..
26:18
BulletWarning
Рет қаралды 4,7 МЛН
Can 6 DEVS Make a STORY Game Without Communicating?
15:32
RoDev
Рет қаралды 2,2 МЛН
What Is The Best AI For Roblox Studio Scripting?
10:42
RoDev
Рет қаралды 446 М.
I Scripted Your Funny Roblox Ideas.. (Part 20)
9:57
TheDevKing
Рет қаралды 854 М.
Best BEGINNER GUIDE to Scripting your FIRST Roblox Game!
19:10
小天使和小丑太会演了!#小丑#天使#家庭#搞笑
00:25
家庭搞笑日记
Рет қаралды 36 МЛН