Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make this script work for every1 at the same time?

so this script is a countdown gui. i forgot how to make it so it works for everyone at the same time. for instance, if someone joins and it begins counting down from 45, when the next person joins it should not start at 45 again, it should be whatever number the first person who joined is.

while true do local time = 45 for i = 1, 45 do wait(1) time = time - 1 script.Parent.Text = tostring(time) end script.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 100 end

1 comment

0

It messed up the code ugh. that should be 9 lines not 3 lol.

1 answer

You could do this server-side with a server (regular) script. Then when the countdown ends, you can use a for loop to get every player and put their health to 100.

The loop would be something like this :

for i,plr in pairs(game.Players:GetPlayers()) do
plr.Character.Humanoid.Health = 100
end

Typed this on mobile so sorry if it looks weird. :P

This discussion is preserved as it was. New answers, comments, and votes are closed.