I have a script here:
Counter = Instance.new("IntValue", workspace)
Counter.Name = "PlayerCount"
Counter.Value = #game.Teams.Eliminating:GetPlayers()
while true do
wait(20)
if Counter.Value < 1 or Counter.Value == 1 then
print("There is a winner")
game.Workspace.Ground:Destroy()
print("Ground has melted")
wait(3)
for _, player in ipairs(game.Players:GetPlayers()) do
player.Team = game.Teams.Eliminating
print("Teams have changed")
game.Lighting.Ground:Clone().Parent = game.Workspace
print("Snow has refrosen")
end
end
end
But the problem with this is that it is not efficiant, so how do I change this script so that instead of doing a loop, it simply waits for the counter value to have a value = or lower than 1.
Thanks in advance.
