The reason I did not use GetPlayers in the players left example is because the players were actually just dummy models, not actual players. So calling GetPlayers would've returned 0 all the time, as they were not real players. Hence, GetChildren. But for actual use in counting players, definitely use GetPlayers over GetChildren. Does the same thing but good practice to use GetPlayers incase you have other objects that it might count as a child which aren't players.
@Danielusss 3 Whether you watched his video about services already or not, it's about getting the amount of something or a type of service that's already built inside the Roblox Studio. saying getplayers lets the script know you want the amount of players or a certain player, in this case : make a variable first so you can encase the information : local players = #game.Players:GetPlayers() --now that you have the amount of players you should be able to use the number of players in the future. while true do if players == 3 then print("adequate players to commence the game") break else print ("not enough players for game to function.") wait() --the wait function with only parentheses are automatically 1 second, so putting 1 is optional. end end for i = 10, 1, -1 do print("the game is starting in". .i"seconds.) end then the rest of the game code.
I tried learning lua from the wiki, and from lualearners and I never grasped it. I do get the concepts but I don't have a sense of what to do next, I never understood how to build off of what I learned and learn something new that could go with what I just learned. These tutorials are really a directional stance of where to go next. Thank you for everything, and I also never knew you could tab multiple lines of code before!
There is a roblox documentation though, but you need knowledge from lua and lua has a documentation in their website (here's the link lua.org) and you'll see that why, and also also i really want roblox to make c#/c++ compiled languages for experienced programmers who are very tired of using lua and that includes me.
After watching all 21 beginner scripting videos by you I have learnt so much and did so much more than I thought I could. Thank you for everything Alvin, I cannot wait for more upcoming scripting videos come out.
watched all episodes in 2 days (well, 3 days if you count the fact that its almost 1am). The most helpful selection of tutorials out there, thank you so much!
@@d4rkxnd_d3vs49 i watched the first episode about a month ago and lost motivation i started again yesterday and am on episode 5 im hoping by the end of this i can code a simple sword fightinf game
Keep up the good work Alvin! Love your videos, and I'm looking forward to the next ones. Could you make a Cframe tutorial with orientation and how to use them?
Oh my god I was able to understand most of the stuff you were saying just based off of previous knowledge and I’m so proud of myself, thankyou so much, Alvin!
So far (till #21) managed to create a print Intermission script, requires 1 player to commence, this video taught me so much all thanks to you alvin: while true do numPlayers = #game.Players:GetChildren() wait(3)
if numPlayers >= 1 then break else if numPlayers < 1 then print("Game requires 1 player to start!") wait(1) end end end wait(5) print("Game is starting soon. Intermission") for i = 30, 1, -1 do print("Intermission: "..i) wait(1) if i == 1 then wait(2) end end
Hey Alvin Blox I have a question! If you break the nested loop and then the condition becomes true again will the nested loop run again or stay forever broken?
Hey there! I like the series and I hope the series will help me. I saw your performance and wondered how did you learned to script.I would like an info
Hey alvinBlox I have been watching you for like years now back when voice was squeaky but besides the point, I would like to ask could you give us like challenges at the end of the video of what we learned like on the events you could've said try and make a countdown happen when a button is pressed on the map like give us challenges to try and use what you tough us in studio
Yay thanks so much I was stuck on a part of my game where I couldn't get the thing to stop moving forward cuz of the while loop but now it's fixed. Thanks so much
Hey AlvinBlox, I just started in Lua and find your videos super helpful when working but I do have a request for you . Can you please make a tutorial on how to break a while loop of a function by using a boolvalue? I tried to do this and the value does switch but the loop does not recognize the break. In theory the code should work and there are no errors. I guess my only problem is that the script is not recognizing when the boolvalue switches from true to false while the server is running.
alvin nice vid nice series plz keep it going until the skills that u teach us is good enough to make a nice game I have so many ideas but Idk how to program so Im following your vids much love keep it up
Short Videos for Alvin - 12mins Short Videos for me-5mins Normal Videos for Alvin - 39mins Normal Videos for me - 12mins Long Videos for Alvin-2hrs Long Videos for me -39mins
It can get either the length of a table or the length of a string. look at the beginning example: local timeLeft = 60 while true do local playersLeft = #game.Players:GetChildren() print(playersLeft) timeLeft = timeLeft - 1 wait(1) end hashtag gets the number of items in a table and returns it as them, so if there were 5 players, “#game.Players:GetChildren()” would equal to 5. Hope this helps, sorry for my bad grammar lol
Finishing this series will not help you understand EVERYTHING Keep watching AlvinBlox's videos, learn more about LUA And then you'll be unstoppable and be able to make whatever you want
if youre using GetChildren(), then just put a few objects (anything works) inside the player service. they will count as children and will work perfectly fine with practice code. to state the obvious, dont do this for real game coding.
For the first part I had to make some adjustments because the script ran too fast before I could even enter so it just moved and and said I wasn’t in the game so I figured I’d put it into a function which runs when I join but that would move on to the next scripts, so I just put a wait on it.
He used the function GetChildren not GetPlayers. So he basically acted like the children inside the service Players was an actual player although it could be a part, etc....
Full Example script of how you might incorporate this into you're game : local PlayersLeft = #game.Players:GetChildren() local RoundTime = 60 repeat wait(1) print("Waiting For Enough Players") until game.Players.NumPlayers
The reason I did not use GetPlayers in the players left example is because the players were actually just dummy models, not actual players. So calling GetPlayers would've returned 0 all the time, as they were not real players. Hence, GetChildren. But for actual use in counting players, definitely use GetPlayers over GetChildren. Does the same thing but good practice to use GetPlayers incase you have other objects that it might count as a child which aren't players.
game.Players.DJH_100.Character.PeeScript.Disabled = false
game.Players.DJH_100.Character.UpperTorso.CFrame = CFrame.new(workspace.Toilet.CFrame)
@@dejay100 Hold up
Entry Point Master watch his services video
@Danielusss 3
Whether you watched his video about services already or not, it's about getting the amount of something or a type of service that's already built inside the Roblox Studio.
saying getplayers lets the script know you want the amount of players or a certain player, in this case :
make a variable first so you can encase the information :
local players = #game.Players:GetPlayers()
--now that you have the amount of players you should be able to use the number of players in the future.
while true do
if players == 3 then
print("adequate players to commence the game")
break
else
print ("not enough players for game to function.")
wait() --the wait function with only parentheses are automatically 1 second, so putting 1 is optional.
end
end
for i = 10, 1, -1 do
print("the game is starting in". .i"seconds.)
end
then the rest of the game code.
ok
I tried learning lua from the wiki, and from lualearners and I never grasped it. I do get the concepts but I don't have a sense of what to do next, I never understood how to build off of what I learned and learn something new that could go with what I just learned. These tutorials are really a directional stance of where to go next. Thank you for everything, and I also never knew you could tab multiple lines of code before!
Awesome to hear CJ!
There is a roblox documentation though, but you need knowledge from lua and lua has a documentation in their website (here's the link lua.org) and you'll see that why, and also also i really want roblox to make c#/c++ compiled languages for experienced programmers who are very tired of using lua and that includes me.
Lua.org
cartPlus and python as well
@@graphitic5578 just make a game through unity...roblox specifically only uses lua. If you’re experienced, go to unity and make a game of your own
After watching all 21 beginner scripting videos by you I have learnt so much and did so much more than I thought I could. Thank you for everything Alvin, I cannot wait for more upcoming scripting videos come out.
watched all episodes in 2 days (well, 3 days if you count the fact that its almost 1am). The most helpful selection of tutorials out there, thank you so much!
It took me like 3 months wow
Still not finished.
But I guess it's all about motivation
@@d4rkxnd_d3vs49 i watched the first episode about a month ago and lost motivation i started again yesterday and am on episode 5 im hoping by the end of this i can code a simple sword fightinf game
took me 2 weeks, watching 1-2 videos a day with a couple days of demotivation in the middle
YES - The videos are coming fast and furious these days. Thank you very much Alvin!
First Person to Script!
No
No
I was already programming in Python
He meant Alvin is the first to script
@@wasihaider2269 how you know :o
I love how the number of views clearly goes down each video. It goes to show how many people give up and who are the more dedicated ones
I'm just built different.
yeah i spotted same thing
yay i belong in dedicated ones
I'm so glad I'm this dedicated, it's pretty easy to because Alvin is a great teacher! I come from python maybe that's why but it's still super easy.
I have been watching you for 1 and a half years and you have helped me to get 75,000 Visits on roblox!
can you tell me what is the name of your game so you get 75,001 visits :3
no rlly i wan't to play your game
What’s your game??
Keep up the good work Alvin! Love your videos, and I'm looking forward to the next ones. Could you make a Cframe tutorial with orientation and how to use them?
Oh my god I was able to understand most of the stuff you were saying just based off of previous knowledge and I’m so proud of myself, thankyou so much, Alvin!
Alvin, I watched your whole series, The only thing I have been waiting for was How to tween guis, Please make a Video on how to tween Gui's
Go to eppobot's channel, tween tutorial is included there.
I love this series!
How many videos are there going to be? I really want to learn more, but how many episodes are there in front of me?
lots, im thinking 40+
@@AlvinBlox that''s not enough
i suppose
you are a very good teacher Alvin.
Yes! I have watched all the videos in the series.
for that first example at 5:50, i put an elseif statement for if the time reaches 0 to also break.
been watching since about 2017, you've helped me get 7,020 place visits on roblox, ty
What’s the game called
What’s it called
Yeah, what's the game called? I promise to play it if u tell me
Or us i guess
what is the game
I've been wondering...
What is this pop up that appears randomly?
Like the one in 3:48
Its a plugin
Or you could also use "repeat until" loops.
Yeah
OK
-from flamingo’s video “terryfiying ppl with roblox admin”
I’m not a fan of FLAMINGO / ALBERT i I i I i I i I just like him xd
@@TheRealOderless635gnat
...
what the fuck
@@TheRealOderless635gnat what
Thank you for the tutorials!
My pleasure!
Been watching since 2016 / 2017
So far (till #21) managed to create a print Intermission script, requires 1 player to commence, this video taught me so much all thanks to you alvin:
while true do
numPlayers = #game.Players:GetChildren()
wait(3)
if numPlayers >= 1 then
break
else
if numPlayers < 1 then
print("Game requires 1 player to start!")
wait(1)
end
end
end
wait(5)
print("Game is starting soon. Intermission")
for i = 30, 1, -1 do
print("Intermission: "..i)
wait(1)
if i == 1 then
wait(2)
end
end
wait(1)
print("Game is starting now!")
how're you doing
Hey Alvin Blox I have a question! If you break the nested loop and then the condition becomes true again will the nested loop run again or stay forever broken?
the break just lets the code outside the nested loop to continue to run, once it cycles back the nested loop will run again
this whole series so far im a good as scripter now lol ty
Alvin pls pls pls upload another one of these vids please ur so helpful
Hey there! I like the series and I hope the series will help me. I saw your performance and wondered how did you learned to script.I would like an info
I love your videos
Your the best
Hey alvinBlox I have been watching you for like years now back when voice was squeaky but besides the point, I would like to ask could you give us like challenges at the end of the video of what we learned like on the events you could've said try and make a countdown happen when a button is pressed on the map like give us challenges to try and use what you tough us in studio
Like what brackeys did with his beginner unity tutorials? That could be cool
Yay thanks so much I was stuck on a part of my game where I couldn't get the thing to stop moving forward cuz of the while loop but now it's fixed. Thanks so much
These help me a lot
Can you make a video going over all the in-built functions? (Or at least all the essential ones)
He did I think
Useful! :D
Hey AlvinBlox, I just started in Lua and find your videos super helpful when working but I do have a request for you . Can you please make a tutorial on how to break a while loop of a function by using a boolvalue? I tried to do this and the value does switch but the loop does not recognize the break. In theory the code should work and there are no errors. I guess my only problem is that the script is not recognizing when the boolvalue switches from true to false while the server is running.
as someone who knows c++ lua looks very simple, i dont know how to code it but I can understand it very well
May I ask you how much time did it take you? Is it hard? Cause I'm really interested in learning it for Unreal Engine.
could you make a vid on teaching us how to use what w have learned
i agree
i love his voice :)
💪💪💪
alvin nice vid nice series plz keep it going until the skills that u teach us is good enough to make a nice game I have so many ideas but Idk how to program so Im following your vids much love keep it up
You don't use mouse when you're editing the screenshot right?
Yess more scripting vids
This is the pre-last tut yay
wow this really helped
also video on module scripts and local scripts i need to know more about them
Short Videos for Alvin - 12mins Short Videos for me-5mins
Normal Videos for Alvin - 39mins Normal Videos for me - 12mins
Long Videos for Alvin-2hrs Long Videos for me -39mins
Can you please make a grid snapping building game tutorial
Many people quit
but
legends stay
Yup, about 6k people
Funny thing is the series started with 300k views
Could you make a tutorial on when you enter a area with a tool a ui pops up
can you make a tutorial on how to make a show/hide players button please?
video about where and how to use commas?
Been here since episode 1
Is this the last episode in the series?
What does tag(#) mean? This one before “game” word? I looked through all the series but I still don’t know is this tag important.
It can get either the length of a table or the length of a string. look at the beginning example:
local timeLeft = 60
while true do
local playersLeft = #game.Players:GetChildren()
print(playersLeft)
timeLeft = timeLeft - 1
wait(1)
end
hashtag gets the number of items in a table and returns it as them, so if there were 5 players, “#game.Players:GetChildren()” would equal to 5.
Hope this helps, sorry for my bad grammar lol
@@zachseb1903 tysm
vrey good
Finishing this series will not help you understand EVERYTHING
Keep watching AlvinBlox's videos, learn more about LUA
And then you'll be unstoppable and be able to make whatever you want
at 0:23 in the video, what does the # before the game.players:GetChildren() mean?
Umm i guess the script need to get the children of players because the script need to count the amount of players in the game to the script works..
It counts the number of children in a parent.
# meaning number, whenever you need the number of players you would do #
thx i need this for my flood escape IV game
Did u finish it? Can i play it
for i = 1, 18, 1 do
print("Happy Birthday!".. i)
if i == 18 then
break
end
-- This whole thing works trust me
wait(31536000)
end
print("Get a job")
if someone resets or dies and i got like a score thing how do i stop it when the player dies or resets ??
Maybe you can make tutorial on disconnect () + when and why to use it :)
thanks for video in my scp game no player only me
petition for alvinblox to stop using dark mode:
how do you unbreak them and let it continue?
Can you make a tutorial on how to give for example x2 money for premium
How half of the people watching this think about this video: Ok, simple.
The other half: e=mc2
Why would you use a break in the example you used for number of players in the game, if you could also write "while game.Players:GetChildren()
Or a repeat until loop, for that matter
Love your videos by the way, learns me so much
moral of the story 'break' breaks a loop
how do i break repeat until loop ?
Me after after ten minutes of trying to change the color of a part:
*Beginner scripting break*
You should make a tutorial for an afk button for how to make a game
what is the hashtag in front of #game ?
GUYS I wanna ask that can it break a repeat loop
i didnt know logic gates is also there
so,its the end?
i have a question, im trying to make a loop start over when a if statement is true, can someone help me?
dont while loops already loop if something is true or false
Wait "||"
How do you simulate having players in the game?
if youre using GetChildren(), then just put a few objects (anything works) inside the player service. they will count as children and will work perfectly fine with practice code. to state the obvious, dont do this for real game coding.
what does # means
6 th! Btw your voice is much deeper now lol ( I we’re around 1 year ago last time )
local user = game.Players:WaitForChild("Alvin_Blox")
while true do
print("Alvin blox is not in the game!")
if user then
break
end
wait()
end
that would literally instantly crash the game if alvin_blox wasnt in the game
good
delicious
Thank you
o
I made the likes number even.
Testing?Pls of the every videos in weeh no have a test project...
For the first part I had to make some adjustments because the script ran too fast before I could even enter so it just moved and and said I wasn’t in the game so I figured I’d put it into a function which runs when I join but that would move on to the next scripts, so I just put a wait on it.
why all learning Roblox Studio is must Print
while disLikes >= 7 do
print("These 7 people who disliked the video. Please give me a single reason to do. [Haters if no reason]")
end
Me = early! :)
anybody = didn't ask
How did you manage to make 2 or more persons in roblox studio?!? :O
Bruh y’all stupid
@@devilsoup3718 no need to be such a pain
He used the function GetChildren not GetPlayers. So he basically acted like the children inside the service Players was an actual player although it could be a part, etc....
@@devilsoup3718 Not everyone has the same ego as you, calm down
your telling me, to break a while loop, all you have to do is say *break*
yup
for the shop items :D
Still using this
bruh how you so smart doe
Full Example script of how you might incorporate this into you're game :
local PlayersLeft = #game.Players:GetChildren()
local RoundTime = 60
repeat wait(1)
print("Waiting For Enough Players")
until game.Players.NumPlayers
Hi
repeat until be like
Time for me to hack NASA
Hey alvin.
Hi Caden!
First
first
u beat me
Congrats you were first
No one cares
@@bat706 You do.
Why else are you in this comment?
@@lua_programmer to tell him that he doesnt care.