I'm trying to get it to where when a player joins or when a player is on a team, that they automatically get a Brick Color added to them, that way I can have the NPC track down the Brick Color instead of "Humanoid" so the NPC's don't all kill each other but will go after the Players instead.
`local Players = game:GetService("Players") local Teams = game:GetService("Teams")
for _, Player in pairs(Players) do if Player.TeamColor == BrickColor.new("Bright red") then BrickColor.new("Bright red") end end`
Is what I cooked up & put in StarterCharacterScripts.. going to try to put in a diff location BUT...
It tells me the error while in StarterCharacterScripts " Workspace.Player'sName.LocalScript:5: bad argument #1 (table expected, got Object)"
Player'sName was my name I just replaced it.
--edit I tried putting it just in workspace and it didn't work either.. :(
I'm trying to do it this way because I cannot figure out a code to get the NPC to follow a teamcolor instead of a Humanoid