#Can someone tell me what I'm doing wrong?
1 messages · Page 1 of 1 (latest)
label.Text = #game.Players:GetPlayers() --declare the label var according to your UI layout
game.Players.PlayerAdded:Connect(function()
label.Text = label.Text + 1
end)
game.Players.PlayerRemoving:Connect(function()
label.Text = label.Text - 1
end)
--optional, for if ResetOnSpawn is set to true inside the ScreenGui instance, while the local script is not located under the screengui
game.Players.LocalPlayer.CharacterAdded:Connect(function()
label.Text = #game.Players:GetPlayers() --depending on this script's location, you can even potentially remove line 1 if you have add line in
end)
i will try this