I'm making a funny game called "Guest Simulator" and you are supposed to have different shirts. But the script won't work.
if char.Shirt == true then char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=57282083" else shirt = Instance.new("Shirt") shirt.Parent = char shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=57282083" end
Output =
Shirt is not a valid member of Model
Script 'Players.Player1.Backpack.LocalScript', Line 19
Try :
(Put this in LocalScript in starterpack)
Player = game.Players.LocalPlayer wait(4) Instance.new("Shirt", Player.Character) wait() Player.Character.Clothing.ShirtTemplate = "http://www.roblox.com/asset/?id=57282083"
It was saying "Shirt Not a valid Member of Model" because it turns out when the shirt is instanced(created) its not called shirt,Its called Clothing.
Hope it helped.
Use :findFirstChild()
to figure out if something exists.
if char:findFirstChild("Shirt") then char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=57282083" else shirt = Instance.new("Shirt") shirt.Parent = char shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=57282083" end