Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you get shirts to load on players?

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

2 comments

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.

0

Thanks that fixed it!

1 answer

✓ Accepted answer

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)

1 comment

0

Still does not work, but thanks for the effort. I even used different shirts so its not the shirt

This discussion is preserved as it was. New answers, comments, and votes are closed.