How to add Roblox Asset link address before a clothing ID?

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

1 Like

Maybe I’m wrong but if you put this when setting the shirt template it should work :

newShirt.ShirtTemplate = "rbxassetid://"..text

Have a nice day !

3 Likes

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

1 Like

Have you tried with the short one because I have made similar system and it works only with this one !

1 Like

I did try with the short one, but it doesn’t apply to the character, quite sad

1 Like

Hmmm …
You can put manually the id on ShirtTemplate and see what happen, I mean what will be wrote automaticly ?
Sorry for my very bad english …

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

1 Like

I have an idea !!!
You can call InsertService and put your shirt in the character !

local remote = game:GetService("ReplicatedStorage"):WaitForChild("AvatarEditor"):WaitForChild("ShirtSpawn").OnServerEvent:Connect(function(plr, text)
	print("Pass Server")
	local newShirtModel = game:GetService("InsertService"):LoadAsset(text)
    local newShirt = newShirtModel:FindFirstChildOfClass("Shirt")
	newShirt.Name = "NewShirt"
	newShirt.Parent = plr.Character
end)

Hmmm …
It’s very strange, I think you can’t do it by this way so …
I recommand you to use InsertService !

Nope, the same thing happens again. Thanks for trying to help out, I appreciate that.

1 Like

You did use this code ???

It’s very strange …
Can you show what happen in your character, I mean in the explorer !

2 Likes

I did use the code you provided.
Here’s the short preview what I meant all this time.

2 Likes

Sorry …
I can’t see the video there’s an error …