while wait(.1) do
p = game.Players:GetChildren()
if #p > 1 then
script.Parent.Text = "A new race will begin in"
wait(1)
script.Parent.Text = "3"
wait(1)
script.Parent.Text = "2"
wait(1)
script.Parent.Text = "1"
wait(1)
script.Parent.Text = "Go!"
----------HERE
elseif #p <= 1 then
script.Parent.Text = "1 more player is needed"
end
end
✓ ANSWER ACCEPTED
First when player have touched the finishline it resets?
1 answer
✓ Accepted answer
You can see if someone touched the finish line using a touched script:
while wait(.1) do
p = game.Players:GetPlayers() --I'm going to use GetPlayers instead of GetChildren.
if #p > 1 then
script.Parent.Text = "A new race will begin in"
wait(1)
script.Parent.Text = "3"
wait(1)
script.Parent.Text = "2"
wait(1)
script.Parent.Text = "1"
wait(1)
script.Parent.Text = "Go!"
workspace.FinishLine.Touched:connect(function(p)
if p.Parent:FindFirstChild("Humanoid") then
local char = script.Parent
local plyr = game:GetService("Players"):GetPlayerFromCharacter(char)
--I got the player and character, you can finish the rest.
end
end
elseif #p <= 1 then
script.Parent.Text = "1 more player is needed"
end
end
Hope it helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.
