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

Why dosen't this check a players leaderstats? [closed]

Asked by 10 years ago
while true do
    if game.Players:GetPlayers().leaderstats.Stage.Value == 45 then
        print("HELLO")
    end 
    wait(1)
end 

Why wont this check all the players leaderstats?

for i,v in pairs(game.Players:GetPlayers()) do
    if v.leaderstats.Stage.Value == 45 then
        print("HELLO")
    end
    wait(1)
end

another test

Locked by adark and evaera

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
2
Answered by 10 years ago
while true do
    for i,v in pairs(game.Players:GetChildren()) do --I'm not sure if GetPlayers is a thing, but I use GetChildren.
    if v.leaderstats.Stage.Value == 45 then
    print("Hello")
    end
    end
wait(1)
end

0
GetPlayers() does exist, just didnt know which one to use, thanks :D NinjoOnline 1146 — 10y
0
No problem/. SlickPwner 534 — 10y
Ad