Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Change the Avatars Shirt.ShirtTemplate?

So I am trying to make it so a player can enter an ID for a clothing/ shirt and then that will get put on an avatar// dummy r15

I get no errors but It wont change the apperance of the shirt

Local Script

local RepS = game:GetService("ReplicatedStorage")

local TextBox = script.Parent.TextBox
local TextButton = script.Parent.TextButton

TextButton.MouseButton1Click:Connect(function()
	
	RepS.SendOverId:FireServer(TextBox.Text) -- this will send over the id the person typed in the textbox
end)

Server Script

local RepS = game:GetService("ReplicatedStorage")

local Shirt = script.Parent.Shirt

RepS.SendOverId.OnServerEvent:Connect(function(player, id)
	
	Shirt.ShirtTemplate = id -- sets the shirt id to the id that the player entered in the local script.
	
end)

https://ibb.co/SBnGrWD it will change the id but not add rbxasset or sum

1 answer

for server script:

shirt.ShirtTemplate = "

local RepS = game:GetService("ReplicatedStorage")

local Shirt = script.Parent.Shirt

RepS.SendOverId.OnServerEvent:Connect(function(player, id)

    Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..  id 

end)

2 comments

0

When I tried it I got no error but It wouldnt update the shirt but the value had changed but when I manually did it when testing I just put the id there and pressed enter and It worked so I guess It cant be updated?

0

Tho I found this on the api: Note, this should be run every time the character spawns. If a developer is looking to permanently change a character’s appearance to a preset it is recommended they use Player.CharacterAppearance.

This discussion is preserved as it was. New answers, comments, and votes are closed.