When the 1st player joins it shows 1 and when the second player joins it shows 2 for him but not for the first player... Any Help?
local Players = game:GetService("Players")
local plr = game.Players.LocalPlayer
function onPlayerAdded(player)
print (#game.Players:GetChildren())
plr.PlayerGui.ScreenGui.TextLabel.Text = #game.Players:GetPlayers()
end
--When a player joins, call the onPlayerAdded function
Players.LocalPlayer.CharacterAdded:connect(onPlayerAdded)
--Call onPlayerAdded for each player already in the game
for _,player in pairs(Players:GetPlayers()) do
onPlayerAdded(player)
end

1 comment
is it in a local script ?