Help on Avatar Editor

Hello Developers! So, yeah, I wanted to make an avatar editor for my game with free roblox shirts, but I am having some trouble with it. When you click the button, it does not make you wear the shirt, it makes you shirtless. I did a localscript that accesses the players shirt ingame, and changes the asset id. I tried it but it didn’t work.
Here’s the script:

local player = game.Players.LocalPlayer
local button = script.Parent
local playerchar = workspace:FindFirstChild(player.Name)

button.MouseButton1Click:Connect(function()
	playerchar:FindFirstChild("Shirt").ShirtTemplate = "https://web.roblox.com/catalog/398635081/Blue-Plaid-Shirt"
end)

:smiley:

Thanks

:smiley:

Hello,
First of all, you need to make the script server sided. (You can do this with a remote function) Because otherwise, only the client will be able to see the changes. And when changing the shirt, you need to use this:

playerchar:FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://398635081"
1 Like

Can you please explain how to do this? Thanks a lot! :smiley:

Oh and I also had the same problem when I made it so if you chose kid, it would show only to the client that they are small sized, and to other clients, normal sized but root part is half way into the ground.

You would need to make a server script that changes the shirt that the player is wearing, you can put this in a function using a remote event. On the client-side, then run this function through the event when your button is pressed. Hope that helps!

1 Like

I am not much of a programmer, so what I got from that was, to make a remote event and trigger it from inside of a server script. But how would it know which player to change? Thanks!

When firing a remove event or a remote function, the first parameter is always the player object.

1 Like

I’m am quite confused… Can you give me my script with the remote event stuff and tell me where to add the remote event and what to call it.

Thanks!

Sorry, if this inconvenient, just tell me. :grinning_face_with_smiling_eyes:

Please read these:

:slight_smile:

1 Like