Hello. I was just scripting clothing editor, like enter the id of the shirt and it will replace the old one.
I was wondering how to add the roblox asset link address before the ID of the clothing.
Here’s the code:
LOCAL SCRIPT:
local button = script.Parent
local function onClick()
print("Pass Local")
local text = script.Parent.Parent.Parent:WaitForChild("Shirt").Text
local remote = game:GetService("ReplicatedStorage"):WaitForChild("AvatarEditor"):WaitForChild("ShirtSpawn")
remote:FireServer(text)
end
button.MouseButton1Click:Connect(onClick)
SERVER SCRIPT:
local remote = game:GetService("ReplicatedStorage"):WaitForChild("AvatarEditor"):WaitForChild("ShirtSpawn").OnServerEvent:Connect(function(plr, text)
print("Pass Server")
local newShirt = Instance.new("Shirt")
newShirt.Name = "NewShirt"
newShirt.Parent = plr.Character
newShirt.ShirtTemplate = text
end)
Everything is working fine except one thing, in the shirt, the ShirtTemplate only has the Shirt ID instead of full Roblox Asset thingy. Can anybody explain me how’s that working? But when I’m in the studio and paste the clothing id, the asset link pops out immediately
Hm, I tried with the big one, “http://www.roblox.com/asset/?id=” since it was adding in the shirt itself in the studio after i put the id of a random shirt. It seems to puts in the ShirtTemplate in the character, but it doesn’t apply to the player, like it exists in the character’s model.
But when I myself manually in the game add clothing (“shirt”) in the character’s model, it shows the shirt with desired id
I was making UI with 3 sets of clothings, Shirt, Pants, T-Shirt and Hat.
I’m currently making custom shirt by making remote event from local script fires server to a server and then from the server it should make clothing (shirt type) and name it Shirt, and Parent will be the player’s who received the remote event character. From there ShirtTemplate should be the TextBox input (id ) and it should make the shirt to the model and making it visible. But it’s only adding the shirt to my character with desired ID but not making it visible.
But when I add shirt manually through explorer in studio play testing and with random shirt id, it shows properly shirt with a big roblox asset before the actual id