Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Change the Avatars Shirt.ShirtTemplate?

Asked by 3 years ago
Edited 3 years ago

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

1local RepS = game:GetService("ReplicatedStorage")
2 
3local TextBox = script.Parent.TextBox
4local TextButton = script.Parent.TextButton
5 
6TextButton.MouseButton1Click:Connect(function()
7 
8    RepS.SendOverId:FireServer(TextBox.Text) -- this will send over the id the person typed in the textbox
9end)

Server Script

1local RepS = game:GetService("ReplicatedStorage")
2 
3local Shirt = script.Parent.Shirt
4 
5RepS.SendOverId.OnServerEvent:Connect(function(player, id)
6 
7    Shirt.ShirtTemplate = id -- sets the shirt id to the id that the player entered in the local script.
8 
9end)

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

1 answer

Log in to vote
1
Answered by 3 years ago

for server script:

01shirt.ShirtTemplate = "
02 
03local RepS = game:GetService("ReplicatedStorage")
04 
05local Shirt = script.Parent.Shirt
06 
07RepS.SendOverId.OnServerEvent:Connect(function(player, id)
08 
09    Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..  id
10 
11end)
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? johnoscarbhv1 137 — 3y
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. johnoscarbhv1 137 — 3y
Ad

Answer this question