game.Players.PlayerAdded:Connect(function(player)
local plr = workspace:WaitForChild(player.Name)
player.CharacterAdded:Connect(function(character)
print("added!")
if player.Team == game.Teams["A team"] then
if player:GetRankInGroup(group) >= rank then
plr.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=shirt"
plr.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=pants"
end
end)
end)
You can try plr:WaitForChild(‘Shirt’).ShirtTemplate which will be more precise, although just create a shirt for them because if they’re not already wearing one it won’t work
if player:GetRankInGroup(group) >= rank then
newShirt = teamAShirt:Clone()
newShirt.Parent = character
newPants = teamAPants:Clone()
newPants.Parent = character
end
You will need to remove the shirt/pants they are already wearing, of course
try this out, characterappearanceloaded is the same as characteradded but it fires after the appearance has fully loaded(shirts&pants included), you also need to create a new shirt and pants when they aren’t wearing any
local shirtID = 0
local pantsID = 0
local group = 0
local rank = 0
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
if player:GetRankInGroup(group) >= rank then
local Shirt = character:FindFirstChildOfClass('Shirt')
local Pants = character:FindFirstChildOfClass('Pants')
if Shirt then
Shirt.ShirtTemplate = 'rbxassetid://'..shirtID
else
Shirt = Instance.new('Shirt')
Shirt.ShirtTemplate = 'rbxassetid://'..shirtID
Shirt.Parent = character
end
if Pants then
Pants.PantsTemplate = 'rbxassetid://'..pantsID
else
Pants = Instance.new('Pants')
Pants.PantsTemplate = 'rbxassetid://'..pantsID
Pants.Parent = character
end
end
end)
end)