Username Character Changer

Hello, I’ve searched over youtube tutorials, developer hub and I have found not much on how to change a character with a users name input.

For example you put a name in a Textbox in a GUI and then the character turns into the username put into the textbox.

I’m not sure how I would do this.

Thank you for reading.

1 Like

I think Players:GetCharacterAppearanceAsync() will come in handy for this.

2 Likes

Okay, I’ve got the text retreaval thing working, but I’m not sure how it would work to find a player not in game.

So if I put a users name in the GUI it will make the character that users avatar, even if they are not in the game.

You must get the Player’s UserId, as that is what you must feed into :GetCharacterAppearanceAsync(). You can do this by using the Players:GetUserIdFromNameAsync function.

Sorry if this sounds stupid, because this type of scripting is all new to me but I’ve got something (probably doesn’t work) but I’m trying to compile bits of different developer hub posts.

So I hvae this
image
That is a local script inside the Textbox which you enter a users name.

This is the character I want to change to the users avatar.
image

I’m not sure how to link the both.

You must run the :GetUserIdFromNameAsync() function from the server-side. Setup a Remote Event to fire with the Player’s Name.

Isn’t Players:GetCharacterAppearanceAsync() dead right now? Not working for me, same issue as in this thread:

HttpService and character API failing

Either way:

I would use a Remote Event to then fire off sending the player name as an argument, then picking up server side to set the player’s character appearance.

Try:

game.ReplicatedStorage.YourRemote.OnServerEvent:Connect(function(player,charID)
    local character = game.Players:GetCharacterAppearanceAsync(charID)
    character.Name = player.Name
    player.Character = character
    character.Parent = workspace
end)

This may not be the best way

6 Likes

I’ll do a test run to verify.

EDIT: API is working fine for me.

He wants the character to be applied to his already existing dummy model ‘Crazy’, so shouldn’t the character be parented to the dummy model instead?

1 Like

Very true - I had written that code as if it was for your own player character.

I’m getting an error for GCAA and others such as GetHumanoidDescriptionFromUserId()

image

In the meantime, check this out Is there a way for you to spawn an NPC based on a player? - #18 by XAXA

1 Like

you might need Studio api services (also thanks for helping me with scripting alot)

2 Likes

Thanks everyone for helping me :slight_smile:

1 Like