I have this script. It checks if a person has clothing when they join( because in some cases people don't have any ) and then, it changes the texture clothes. But, for some reason, it doesn't work. Can someone help?
function addClothing()
if game.Players.LocalPlayer.Character:FindFirstChild('Pants') or game.Players.LocalPlayer.Character:FindFirstChild('Shirt') or game.Players.LocalPlayer.Character:FindFirstChild('Pants') and game.Players.LocalPlayer.Character:FindFirstChild('Shirt') then
local clothing = game.Players.LocalPlayer.Character:GetChildren()
for i, v in pairs(clothing) do
if v.className == 'Shirt' then
game.Players.LocalPlayer.Character:FindFirstChild('Shirt').ShirtTemplate = game.Players.LocalPlayer:FindFirstChild('BikeProperties').ShirtID.Value
game.Players.LocalPlayer.Character:FindFirstChild('Pants').PantsTemplate = game.Players.LocalPlayer:FindFirstChild('BikeProperties').PantsID.Value
end
end
for i, v in pairs(clothing) do
if v.className == 'Pants' then
game.Players.LocalPlayer.Character:FindFirstChild('Shirt').ShirtTemplate = game.Players.LocalPlayer:FindFirstChild('BikeProperties').ShirtID.Value
game.Players.LocalPlayer.Character:FindFirstChild('Pants').PantsTemplate = game.Players.LocalPlayer:FindFirstChild('BikeProperties').PantsID.Value
end
end
else
local createPants = Instance.new('Pants')
createPants.Parent = game.Players.LocalPlayer.Character
createPants.Name = 'Pants'
local createShirt = Instance.new('Shirt')
createShirt.Parent = game.Players.LocalPlayer.Character
createShirt.Name = 'Shirt'
end
end

3 comments
Is it in a Server Script or a Local Script?
LocalScript
It spawns in your GUI when you join