Im trying to make a script when a player is added, it changes the name of the player to #1 then #2 for next player to enter then #3 when next player enters and continues on. I know that you would probably use PlayerAdded function and new.Player, but I'm not sure how to make it give the player the number for the name then increase for the next player, help please?
COMMUNITY QUESTION
PlayerAdded Function help?
2 answers
local num = 1
Game.Players.PlayerAdded:connect(function(Player)
local nm = num
num = num + 1
Player.CharacterAdded:connect(function(Char)
wait() --So the character has time to load fully.
Char.Name = "#" .. nm
end)
end)
num in that script will increment by 1 for every Player than joins the game. It will not fill in numbers for Players leave, however, but the characters' names will persist through death.
It is (iirc) not possible to change the name of the Player objects, but you can change the name of the corresponding character Model.
I just tried that, it is impossible. ROBLOX does not allow you to rename player names or character names.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
I feel like it works some way but I wanted it to like make the number appear on top of the players head which does not happen with your script:-(
This... does appear over their heads? I'm not sure exactly what it is you are looking for.