Hello!, i have a script that works very well, but sometimes it give me a error on console saying like "Shirt was not found on (player name)", is there any way to if script dont found the shirt on avatar, the script create a shirt and put inside the player who touched the part? heres my script :
local ChangerPart = script.Parent
local ShirtTemplate = "http://www.roblox.com/asset/?id=1234"
local PantsTemplate = "http://www.roblox.com/asset/?id=1234"
ChangerPart.Touched:Connect(function(TouchPart)
if TouchPart and TouchPart.Parent and TouchPart.Parent:FindFirstChild("Humanoid") then
print(TouchPart.Parent.Name .. " - Changed clothes")
local Character = TouchPart.Parent
Character.Shirt.ShirtTemplate = ShirtTemplate
Character.Pants.PantsTemplate = PantsTemplate
wait(3)
end
end)
Also this script its from a youtube tutorial channel, but i made some changes!

2 comments
Thank you so much! :D
No problem, accept my answer if it helped so we can get them sweet sweet rep points