Hey everyone. What I'm trying to make it's so like the NPC evaluates the player torso's BrickColor for it add to the "allies" array. It doesn't seems to function but it doesn't results on an error either. I've trying to figure a way to do this.

Edit: I'm using R6 rigs for they are easier to work with

Here's the code:

game.Workspace.ChildAdded:Connect(function(char)
	if char.Name == game.Players:FindFirstChild(char.Name) then
		if char.Torso.BrickColor == BrickColor.new("Bright blue") then
			 table.insert(allies,char.Name)
		else
		end
	end
end)

If there's something I haven't seen or a better way to achieve this, please leave it on the comment section. All feedback is appreaciated.

3 comments

0

Are your rigs R6 or R15? You used "Torso" instead of "Upper Torso" or "Lower Torso".

0

Or just apply a NumberValue or StringValue to the player's character to designate their team -- the torso color can be handled separately.

0

I'm using R6 rigs