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)
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:
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!
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!