I have this part of my game script when the bool value turns true then the game should stop but then when I change it to true in server storage when testing it in studio the round will not end. Can you help?
for _,player in pairs(Game.Players:GetChildren()) do
local Gui = player.PlayerGui.Gui
Gui.Label.Text = LocationMsg
repeat
wait(1)
GameTime = GameTime - 1
Gui.Label.Text = "Game time: "..GameTime
until GameTime == 0 or IsBombDisarmed == true
if IsBombDisarmed == true then
Gui.Label.Text = WinMsg
for _, player in pairs(Game.Players:GetChildren()) do
local Gui = player.PlayerGui.Gui
Gui.Label.Text = WinMsg
player.leaderstats.Credits.Value = player.leaderstats.Credits.Value + WinningAmount
wait(2)
GameTime = RestoreGameTimeAmmount
break
end
elseif GameTime == 0 then
for _, player in pairs(Game.Players:GetChildren()) do
local Gui = player.PlayerGui.Gui
Gui.TextLabel.Text = LoseMsg
wait(2)
GameTime = RestoreGameTimeAmmount
break
end
end
end
end
end

1 comment
Maybe try putting it in a loop, like a repeat until the value is turned to true