So this script needs to end the for loop after the calloff = true else statement, after it runs those ending lines, It still loops, How would I fix that from looping after 'else'?
for racewait = 100, 0, -1 do
if calloff == false then
wait(1)
game.Workspace.StartingLine.Timer.SurfaceGui.Time.Text = "Race time: "..racewait
for _, Player in pairs(game.Players:GetChildren()) do
if Player:IsA("Player") then
Player.PlayerGui.MainGui.TimeFrame.Timer.Text = "Race time: "..racewait
end
end
else
wait(3)
game.Workspace.StartingLine.Timer.SurfaceGui.Time.Text = game.Workspace.Positions.First.Value.." has won!"
for _, Player in pairs(game.Players:GetChildren()) do
if Player:IsA("Player") then
Player.PlayerGui.MainGui.TimeFrame.Timer.Text = game.Workspace.Positions.First.Value.." has won!"
end
end
wait(2)
game.Workspace.StartingLine.Timer.SurfaceGui.Time.Text = game.Workspace.Positions.Second.Value.." came in 2nd"
for _, Player in pairs(game.Players:GetChildren()) do
if Player:IsA("Player") then
Player.PlayerGui.MainGui.TimeFrame.Timer.Text = game.Workspace.Positions.Second.Value.." came in 2nd"
end
end
wait(2)
game.Workspace.StartingLine.Timer.SurfaceGui.Time.Text = game.Workspace.Positions.Third.Value.." came in 3rd"
for _, Player in pairs(game.Players:GetChildren()) do
if Player:IsA("Player") then
Player.PlayerGui.MainGui.TimeFrame.Timer.Text = game.Workspace.Positions.Third.Value.." came in 3rd"
wait(2)
end
end
end

2 comments
You would use the break keyword to end a loop abruptly.
thx