How to refer to roblox player avatar?

Hi, lately I’ve been creating a character system: Ideas to make this character system
but I need to know how to refer through variables the avatar of the local player in roblox

1 Like

There are a few ways to get the Player’s character on the client.

I primarily use this on the client:

local Player= game:GetService("Players").LocalPlayer
local Char = Player.Character

A few things to note:
1: This does not update when the character respawns. You will have to reassign the var
2: This can run before the player’s character spawns, so it might be worth it to use Player.CharacterAdded:Wait()

Hope this helps

2 Likes

game:GetService(“Players”).LocalPlayer.Character

2 Likes

You know in my game I have personalized characters and if I do that it won’t work I’m speaking from abroad that is, the avatar of roblox

1 Like

useful but it doesn’t work either look at the other post

1 Like

What do you mean by avatar?

Accessories will be found in the Character

Shirts and pants are variables that can be added to Character

1 Like

Could you define what exactly you are trying to do?
If you are trying to make your own custom avatar to force players to use, a good place to start is putting
a character model names “StarterCharacter” in StarterPlayer.

1 Like

It would be helpful if you explained what you mean by avatar.

You can get the character with Player.Character and/or Player.CharacterAdded.

You can get a description of the player’s outfit with Players:GetHumanoidDescriptionFromUserId

https://create.roblox.com/docs/reference/engine/classes/HumanoidDescription

You can get the current description of a character by getting the HumanoidDescription inside the character Model.

1 Like

No, that’s not what I explained, excuse me. The point is that the game will have a story mode and that story mode is based on a character that I create but I want that when a player enters he has that character but when another player looks at him he sees him with his Roblox skin (it’s like to create the illusion that he is the only one with the main character) is the theme in summary: that on the client side it has the avatar of the main character but on the server side it has the avatar of roblox

1 Like

You can probably* do that with Humanoid:ApplyDescription or Humanoid:ApplyDescriptionReset on the client.

* Might not work properly on client side, you would need to test it.

So basically get the character in a client script with the methods people said above, get the humanoid of the character, call the function with the description of your main character.


I looked at that topic. I don’t understand what you mean by there is “no solution”. It would be helpful if you explained how this isn’t a solution and what it doesn’t do that you want.

To set the local copy of the character to your main character outfit use Humanoid:ApplyDescription on the client with the main character description. To change the local copy of the character back to their outfit get the description with Players:GetHumanoidDescriptionFromUserId and apply it with Humanid:ApplyDescription on the client.

1 Like

notice something is that there is no solution so you will have to change the plan
what if you look at this topic:

What do you think about this idea?

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.