So i want to make a round system, like a deathmatch. The round is 10 minutes Long but if a player gets 30 kills then i want a bool value to be set to true. Therefore i want the round system to break once the bool value sets to true. How can i do this? Please help.
I would use a changed
kills.Value.Changed:Connect(function() -- You can check how many kills they have and if they have a certain number it ends the game if kills.Value == 30 then -- end the game end end)
I don't recommend using a while true do/ while wait() do or a repeat until since it checks a ton of times instead of just doing smthing when the value changes it makes the game lag a little.
if its a variable in a scrip do:
while wait(0.1) do if Bool ~= true then --Code else break --ends the loop end end
if its a value do:
Bool:GetPropertyChangeSignal("Value"):Connect(function() if Bool.Value ~= true then --Code else return end end)
Thats exactly what repeat until loops are for.
repeat -- round logic until (statement)