✓ Accepted answer
What it looks like to me is that your running the function once, immediately when the first player joins. Assuming your doing this, that's your problem. The script runs before/while the second player connects. What you'll need to do is call the function when a new player joins, perhaps like this?
game.Players.OnPlayerAdded:connect(function(player)
local NumPlayers = #game.Players:GetPlayers();
if NumPlayers > 1 then
else
print("Not enough players")
end
end)
Of course, that just a suggestion, you should do it however you see fit.
Also, notice how I define the number of players in the 'OnPlayerAdded' function, and not outside of it. This way, the game can check the number of players each time a new one joins. Of course, it wont run/check how many there are if a player leaves, but you can fix that if need be. Hope this helps! :)
1 comment
If any of these answers help you, mind accepting them so people know the problem's been solved?