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

Changing shirts and pants using an Asset ID? [Not Working]

Asked by 4 years ago
Edited 4 years ago

https://gyazo.com/5fe2daa70c48e094fc65647396e769fa My script only removes my shirt

local replicatedStorage = game:GetService("ReplicatedStorage") local remoteEvent = replicatedStorage.RemoteEvent local insertService = game:GetService("InsertService")

remoteEvent.OnServerEvent:Connect(function(localplayer, code, assetId) local character = localplayer.Character local humanoid = character.Humanoid

if code == "Clear" then
    humanoid:RemoveAccessories()
elseif code == "Hats" then
    local hatId = tonumber(assetId)
    local hat = insertService:LoadAsset(hatId):GetChildren()[1]
    hat.Parent = localplayer.Character
elseif code == "Pants" then
    local pantsId = assetId
    humanoid.Parent.Pants.PantsTemplate = pantsId
    print(pantsId)
elseif code == "Shirts" then    
    local shirtsId = assetId
    print(humanoid)
    print(humanoid.Parent.Shirt)
    humanoid.Parent.Shirt.ShirtTemplate = assetId
    print(shirtsId)
end

end)

Specifically this section was ran

elseif code == "Shirts" then    
    local shirtsId = assetId
    print(humanoid)
    print(humanoid.Parent.Shirt)
    humanoid.Parent.Shirt.ShirtTemplate = assetId
    print(shirtsId)
end
0
I'm not sure, but i think you have to put rbxassetid://..assetId and rbxassetid://..pantsId but i may not be right. LennyPlayzYT 269 — 4y
0
Ah I actually did that look at my gyazo image https://gyazo.com/5fe2daa70c48e094fc65647396e769fa My script only removes my shirt LuaBaker 0 — 4y

Answer this question