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 2 years ago
Edited 2 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

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

Log in to vote
1
Answered by 2 years ago

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)
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 — 2y
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 — 2y
Ad

Answer this question