Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Doesn't always get winner?

Asked by 8 years ago

Hi guys! Any ideas why this sometimes works and sometimes doesn't? I have checked with printing that when this is called, at least one player has the value set to true but it still doesn't work :( it works sometimes, though! Any ideas? ANY help would be appreciated! Thanks.

function GetWinner()
for i,v in pairs(game.Players:GetPlayers()) do
    if v:findFirstChild'Playing' then
        if v.Playing.Value == true then game.Workspace.Winner.Value = v.Name       game.Workspace.WinnerID.Value = v.UserId
        else print("No winner")
            game.Workspace.Winner.Value = "NoWinner"
            game.Workspace.WinnerID.Value = 1
end
end
end
end
0
Doesn't it awlwat' NinjoOnline 1146 — 8y
0
Add a print after FindFirstChild'Playing' then and tell me if that prints everytime NinjoOnline 1146 — 8y

Answer this question