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

If There Are On Server 2 Players, Game Starts, What Am I Doing Wrong?

Asked by 5 years ago

If there are on game 2 Players or more, Game Starts, If there is 1 player it prints that More players are needed, any help pls?

local players = game.Players:GetPlayers()
local PlayerCount = 0


game.Player.PlayerAdded:Connect(function()
PlayerCount = PlayerCount + 1
end)

game.PlayerRemoving:Connect(function()
PlayerCount = PlayerCount - 1
end)

If PlayerCount < 1 then do
print("We Need More Players")
else

--- Runs other script ....
0
Unnecessary do-end block and the beginning of your if statement is capitalized. Pay attention to the output window. ScriptGuider 5640 — 5y
0
Still, I corrected it doesn't work ItzJester2 12 — 5y

Answer this question