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

PlayerAdded Help? [Script Included]

Asked by
Vividex 162
10 years ago
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)

Its supposed to change the name above the person heads (For Example: When you join the game your name is above your head) Its supposed to change the name to #1 for the first person to join then for the next person to join it changes their name to #2 and keeps increasing when a new player enters its supposed to keep your number as your name when they reset, but it doesn't change your name .-.

Help please?

3 answers

Log in to vote
2
Answered by
User#2 0
10 years ago

You cannot change a Character's name very easily. In fact, you cannot change the name of the actual character, but it is possible to get a new one to appear in place of the one in-game.

There's a nice little trick with Humanoids where when the Head is invisible, the name tag is also invisible. Using this knowledge we can make a "Fake Name Tag".

First, you want to make a Model in their character with the Name of the new name you want to appear above their head.

Second, you clone the player's head and parent the newly cloned head into the newly created model. This will be our "Fake Head".

Third, you weld the Fake Head to the real Head.

Fourth, you add a Humanoid to the Fake-Head Model.

Fifth, you want to make the character's head invisible.

This will simply change the name, but health won't replicate. This can be fixed by changing the fake head's humanoid's Health to the same Health (and MaxHealth) of the real Humanoid.

Ad
Log in to vote
-1
Answered by 10 years ago

You can't change the players name, as it is server-side. I apologize.

Log in to vote
-3
Answered by 10 years ago

Change the character's humanoid instead.

Char.Humanoid.Name = "#"..nm
0
..No? Changing the humanoid's Name property has no effect on the Character's name. All this does is break resetting, among a few other things that rely on the Humanoid's name. User#2 0 — 10y
0
Sorry if I am wrong, I never really use roblox's default humanoids. PiggyJingles 358 — 10y

Answer this question