I have a script that change clothing, sometimes the script dont find a shirt, so the script create a new shirt on the player, and it comes with name "Clothing", and the script cant to find the shirt because the name is different, can someone help me? 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 local shirt = Character:FindFirstChildOfClass("Shirt") local pants = Character:FindFirstChildOfClass("Pants") if not shirt then shirt = Instance.new("Shirt", Character) end if not pants then pants = Instance.new("Pants", Character) end Character.Shirt.ShirtTemplate = ShirtTemplate Character.Pants.PantsTemplate = PantsTemplate wait(3) end end)
(I got this script from a youtube tutorial, and i made some changes, and a guy helped me to make the system to create a new shirt if dont find one)
lol hi again.
if not shirt then shirt = Instance.new("Shirt", Character) shirt.Name = "Shirt" end if not pants then pants = Instance.new("Pants", Character) pants.Name = "Pants" end