#How to end a round when reaching a number of crowns
15 messages · Page 1 of 1 (latest)
Every single time it adds a point to their total, add a conditional to see if they are at 25 crowns
how should i go about that
im not the greatest with scripting
while wait() do
wait(0.5)
if workspace.KingHills.King1.Owner.Value == script.Parent.Parent.Name then
wait(1)
local plr = script.Parent.Parent
plr.leaderstats.Crowns.Value = plr.leaderstats.Crowns.Value + 1
end
end
this is the script i currently have
Couple nit-picks on the code
Instead of while wait() do wait(0.5) you can just do
While wait(0.5) do
And secondly
while wait() do
wait(0.5)
if workspace.KingHills.King1.Owner.Value == script.Parent.Parent.Name then
wait(1)
local plr = script.Parent.Parent
plr.leaderstats.Crowns.Value = plr.leaderstats.Crowns.Value + 1
if plr.leaderstats.Crown.Value >= 25 then break -- here is where you can add a win effect
end
end
so i should just copy this and put it in my script
** You are now Level 1! **
after the break will it effect all other players and prevent them from gaining crowns
If this isn't a local script, then yes