I want to make a game where one random player spawns at one point while the rest of the players spawn at another block. I truly appreciate all your help but I am really trying to learn how to code in Roblox. I barely started two weeks ago and thanks to you guys, I can now clone blocks, create debounces, and create block GUI's on my own. My first game is almost done but I can't do it without you guys. Here is my current script:
local TextBox = script.Parent
local Spawn = game.Workspace.Spawn
if TextBox then
TextBox.Text = 'intermission'
wait(4)
TextBox.Text = '10'
wait(1)
TextBox.Text = '9'
wait(1)
TextBox.Text = '8'
wait(1)
TextBox.Text = '7'
wait(1)
TextBox.Text = '6'
wait(1)
TextBox.Text = '5'
wait(1)
TextBox.Text = '4'
wait(1)
TextBox.Text = '3'
wait(1)
TextBox.Text = '2'
wait(1)
TextBox.Text = '1'
wait(1)
TextBox.Text = "loading"
wait(3)
game.Players.PlayerAdded.Position = Spawn.Position
end
I know that there are math scripts to do the -1 second instead of typing all the text scripts, but that will be for another time. When the loading text starts and the wait is over, I want one player to be randomly selected to spawn at one point, the rest to another. I would love for you to be so kind and teach me how to script this. Thank you so much!
Sincerely,
Or2no

6 comments
if you'd also like me to set up the "math" equation, please comment aswell.
Already looking at the script, I have questions. Throughout Youtube videos and other script responses, I see people state letters such as in this case: i and v. What do these letters represent? It always confused me to see for i, v in pairs. I would also like to know what pairs does in a script. Thank you :)
The letters can be changed; and they don't have any effect on the command. If you'd like to ask more questions, since I don't like to paragraph on SH, my Discord is aman#8707. For Instance, "for i,v in pairs(game:GetService("Players"):GetChildren()) do print(i,v)". When this prints, nothing will be the same. If you have one player in the game, it will print: "1 PlayerName". If you have two players
(line - downs are marked by "--") : "1 PlayerName -- 2 PlayerName". I know this is not a good way to make you understand, but SH formatting is difficult.
print v.Name*
For the second question of your comment, a "for" loop just runs through an object's children, and gets their data. These are stored in the default, I and V. I being the number from the parent, and V being the actual object inside of the parent. It's a very simple concept, but it is massively relied on by many programmers. Hope I could help :)