Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

PLR function not working when I test it ?

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		if character.TeamColor == "Dark Blue"
			then
			character.Shirt.ShirtTeamplate = "https://www.roblox.com/Police-item?id=458386092"
		end
	end)
end)

I played it and it did not work

1 comment

0

Just a heads up, you need to make sure everything is in the right format and spelling. i.e. "ShirtTemplate" and "rblxassetid://itemCode"

1 answer

✓ Accepted answer

The "character" is the players model and does not contain they TeamColor so this scrip will not work, but the player does contain TeamColor.

TeamColor is a BrickColor , as you are using the name then we must get the name of the brick color which is one of its Properties.

Solution:-

game.Players.PlayerAdded:connect(function(player)
	-- the character is the players model
    player.CharacterAdded:connect(function(character)
        if player.TeamColor.Name == "Dark blue" then -- we can check the name of the brick color it is "Dark blue" not "Dark Blue", there are other methods
            print('plr is blue')
        end
    end)
end)

Hope this helps.

This discussion is preserved as it was. New answers, comments, and votes are closed.