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

Help me with this script?

Asked by 10 years ago

I'm trying to test if there is 2 or more players why won't it work?

while true do
F = Game.Players.NumPlayers
wait(.1)
end

while true do
if F = 2 then

    end
end
0
The first loop never ends because the condition will always be true. Try having only one while loop with both parts in them. Necrorave 560 — 10y

1 answer

Log in to vote
0
Answered by
lomo0987 250 Moderation Voter
10 years ago
while true do
wait(.1)
    if Game.Players.NumPlayers =< 2 then
        -- code here
    else
        print("Not enough Player")
    end
end

There. :D

Ad

Answer this question