Player's clothes not changing?

for some reason this script isn’t working…

        teams[3].PlayerAdded:Connect(function(player)
            local plr = workspace:WaitForChild(player.Name)
                player.CharacterAdded:Connect(function(character)
                		character:WaitForChild("Humanoid").Died:Connect(function()
                			if player.Team == teams[3] then
                				if player:GetRankInGroup(8349025) >= 3 then 
                					plr.Shirt.ShirtTemplate = "https://www.roblox.com/catalog/SHIRT/"
                					plr.Pants.PantsTemplate = "https://www.roblox.com/catalog/PANTS/PANTS"
                				end
    end)
 end)
                			
                		if player:GetRankInGroup(8349025) >= 3 then 
                					plr.Shirt.ShirtTemplate = "https://www.roblox.com/catalog/SHIRT/"
                					plr.Pants.PantsTemplate = "https://www.roblox.com/catalog/PANTS/PANTS"
                				end
        end)

excuse formatting

Output?

Also, I’m not sure that you can use .PlayerAdded to anything other than game.Players; try ChildAdded if team[3] is an instance?

there’s not output. Wdym childadded? to do plr:ChildAdded() ?

also, it works when i first switch teams, but when i reset it doesnt work

what is “teams[3]”? You can try teams[3].ChildAdded:Connect(function(player)

Oh, in that case the script you currently have will only run when a player is added to a new team…When you die nothing happens because I think you need player.CharacterAdded Workspace.ChildAdded to Workspace to be outside of your PlayerAdded function

oh right… and teams[3] is part of an array…

example:

local teams {
 "something",
"something"
"something"
}

Also, the clothes change but they don’t show the shirt (meaning when it changes, it doesn’t put anything)… it jut removes the player’s current shirt and replaces it with nothing… know a fix?

Could have used this info before but the script is working if something happens at least, not sure why the clothes don’t work after the first time.

no… it never works… Like the shirt never changes… it just puts nothing

Any ideas as to why this is happening @Blue_Jays ?

Try using http://www.roblox.com/asset/?id= or just the number by itself

You’re changing the character after it’s killed?
character:WaitForChild("Humanoid").Died:Connect(function()

Yeah I think that’s the biggest problem, looks like you’re changing the clothes after the player dies

try to add an event or in the same way the players will not be able to see the shirt or pants maybe this is the problem.

figured it out… works now! Thanks!

Yes, when they reset or whatever. Why?

It works fine when they join the team, but not when they reset… why is this?

game.Players.PlayerAdded:Connect(function(player)
	local plr = workspace:WaitForChild(player.Name)
	player.CharacterAdded:Connect(function(character)
		character:WaitForChild("Humanoid").Died:Connect(function()
			if player.Team == teams[3] then
				if player:GetRankInGroup(ID) >= NUMBER then 
					plr.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=Shirt"
					plr.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=Pants"
				end
    end)
end)

When they die it immediately changes clothes…try removing this line

		character:WaitForChild("Humanoid").Died:Connect(function()

Still doesn’t work… Any other ideas? @Blue_Jays