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

How do you get shirts to load on players?

Asked by 6 years ago

I am trying to change the shirt on players when they touch a part. But I am getting a failed to load image even when I use different shirts. I get the error in both studio and live game(hitting green play button on games page)

This is the code I have:

function touch(hit)
    print("Giving armor")
    hit.Parent.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=2154170154"
end

script.Parent.Touched:Connect(touch)

Error: 12:05:16.456 - Image "https://assetgame.roblox.com/asset/?id=2154170154" failed to load in "Workspace.bumblebeejake.Humanoid.Clothes": Request failed

0
The error means the assetId couldn't load. You can just make a shirt with the assetId, and parent it to somewhere. Then you could make a script that removes the player's current shirt and clones the new shirt. User#22219 20 — 6y
0
Thanks that fixed it! bumblebeejake 5 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

You can use this script to work:

function touch(hit)
   if hit.Parent == game.Players.LocalPlayer.Character then
    print("Giving armor")
    hit.Parent.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=2154170154"
end
end

script.Parent.Touched:Connect(touch)
0
Still does not work, but thanks for the effort. I even used different shirts so its not the shirt bumblebeejake 5 — 6y
Ad

Answer this question