frrazers
(Frazer)
December 13, 2020, 9:56am
#1
local ShirtTotal = 0
for i,v in pairs(game.ReplicatedStorage.Client.Shirts:GetChildren()) do
ShirtTotal = ShirtTotal + 1
local imgbut = script.Parent.ShirtSelector.Template:Clone()
imgbut.Parent = script.Parent.ShirtSelector
imgbut.Visible = true
local AssetId = v.AssetId.Value
imgbut.Name = "Shirt"..ShirtTotal
imgbut.Image = "https://www.roblox.com/asset-thumbnail/image?assetId="..AssetId.."&width=420&height=420&format=png"
imgbut.ShirtText.Value = "rbxassetid://"..v.AssetId.Value
imgbut.MouseButton1Click:Connect(function()
print(imgbut.Name)
workspace.JoinDummy.Shirt.ShirtTemplate = imgbut.ShirtText.Value
end)
end
The JoinDummy
’s shirt does not change, any help on why?
ReelPlum
(Plum)
December 13, 2020, 10:35am
#2
I’m not quite sure what you mean here, but i think you mean it’s not changing on the server.
It looks like you’re doing this in a localscript, which means it’s not going to be replecated to the server. You should call a remoteevent and change the shirt template on the server.
If you’re not quite sure what i mean by “on the server”, then watch this video.
frrazers
(Frazer)
December 13, 2020, 10:42am
#3
I wanted it changed on the client as it’s for an avatar editor, however, the shirt will not change on the client.
ReelPlum
(Plum)
December 13, 2020, 10:47am
#4
Ok. I think there’s two ids for a shirt. You need the assetid, which you can get from putting the shirt on a dummy in studio manually.
frrazers
(Frazer)
December 13, 2020, 10:49am
#5
I have the AssetId
, which is the asset it’s self, then I need to try and find the TextureId
to apply to the shirt.
Each button that is cloned has a child named ShirtText
, which just stands for ShirtTexture.
And I do not know how to get the shirts TextureID from the asset ID other than doing it manually, but that’s not convenient.
frrazers
(Frazer)
December 13, 2020, 10:54am
#6
Nevermind, I think I need to do it manually.
MZigi
(stein)
December 13, 2020, 11:00am
#7
I think you can use InsertService:LoadAsset to load in clothing using the AssetId.
frrazers
(Frazer)
December 13, 2020, 11:01am
#8
I’ve tried that, it cannot be used locally.
ReelPlum
(Plum)
December 13, 2020, 11:36am
#9
I think the best way would be using a remotefunction to get the server to use insertservice . Then return the shirt which has been inserted and copy it to the client. This is the best scaleable and automatic way i can think of.
Ty_Scripts
(IAmTrulyGreg)
December 13, 2020, 11:49am
#10
Save the shirts to ReplicatedStorage and clone the shirts onto the Dummy. Easiest way to do it if there’s a limited amount of shirts.
Are you sure you’re writing this in a Server Script?
ReelPlum
(Plum)
December 13, 2020, 11:52am
#12
See the replies above… He says he doesn’t want it to change on the server.
Or, as I scrolled it up, you told that you were going to do an avatar editor, I would agree with Ty on that the best way to locally apply clothing onto the character is of course cloning those.
Try cloning a shirt instance into the character.
frrazers
(Frazer)
December 13, 2020, 12:55pm
#14
I did it, basically I just made an extra value and placed the textureId inside of it.