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

How to prevent a Ai from attacking a player on a certain team?

Asked by 9 years ago

I understand this is not a website for asking people to write you a script from scratch but this is a question ive been wondering for a long time how can I make a Ai identify players on a team? I just cant seem to make a script that works

1 answer

Log in to vote
3
Answered by 9 years ago
if game.Players:GetPlayerFromCharacter(character).TeamColor == AI.ColorNotToAttack.Value then
--dont attack
else
--attack
end

You would need if statements and a value in the AI to know which team not to attack

4
Put the code inside a Lua code block. NotsoPenguin 705 — 9y
Ad

Answer this question