So i have this script so far
pnts = script.Pants
shirt = script.Shirt
function GiveClothes(character)
if not character:findFirstChild("Shirt") then
shirt:Clone().Parent = character
else character:findFirstChild("Shirt"):Destroy()
shirt:Clone().Parent = character
end
if not character:findFirstChild("Pants") then
pnts:Clone().Parent = character
else character:findFirstChild("Pants"):Destroy()
pnts:Clone().Parent = character
end
end
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(char)
wait(1.12)
local plr = game.Players:findFirstChild(char.Name)
print(char.Name)
if plr.TeamColor ~= BrickColor.new("Lime green") then
return
else GiveClothes(char)
end
end)
end)
But the thing is when i add another uniform and add the script with that other team it just makes that other team uniform have no clothes on, but the first team has its properly set uniform, how can i add two of the same script but with out having them use the same shirt and pants path? Here is the second team script that wont work correctly
pnts = script.Pants
shirt = script.Shirt
function GiveClothes(character)
if not character:findFirstChild("Shirt") then
shirt:Clone().Parent = character
else character:findFirstChild("Shirt"):Destroy()
shirt:Clone().Parent = character
end
if not character:findFirstChild("Pants") then
pnts:Clone().Parent = character
else character:findFirstChild("Pants"):Destroy()
pnts:Clone().Parent = character
end
end
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(char)
wait(1.12)
local plr = game.Players:findFirstChild(char.Name)
print(char.Name)
if plr.TeamColor ~= BrickColor.new("Really red") then
return
else GiveClothes(char)
end
end)
end)

1 comment
please tab your coding correctly as it makes it harder to read for people trying to help you