Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make "allies" update its contents?

Asked by 3 years ago

My problem is that once the player gets added, "allies" will not update resulting in the NPC not shooting at the player from the enemy team. I'm using R6 rigs. Every idea or comment is appreaciated.

local allies = {script.Parent.Name,"Civilian"}

game.Players.PlayerAdded:Connect(function(player)
        player:GetPropertyChangedSignal("TeamColor"):Connect(function()
        if player.TeamColor == BrickColor.new("Really blue") or BrickColor.new("New Yeller")  then
            table.insert(allies,player.Name)
        else
        end
    end)
end)

Answer this question