I’ve been working with this imported NPC for quite a while now but I have yet to script a way so the NPC recognizes the player’s team color.
This is the script I’ve been working with:
The modification takes place at lines 63 to 71
Soldier AI-B.lua (13.7 KB)
This is the setup I have for testing:
Setup explanation
Where the “Really blue” SpawnPoint is for the “Police” team, the “New Yeller” SpawnPoint is for the Citizens and the “Bright red” SpawnPoint is for the Criminals. The neutral SpawnPoint is for me to be able to spawn towards the other SpawnPoints.
Criminals attack both Citizens and Police
Police only attacks Criminals
What I am trying to achieve
I’m trying to achieve so the NPC recognizes the TeamColor of the player and checks it constantly so the NPC knows who to be aggressive towards and who to not
If there’s any other detail requiered for a better approach, let me know and I’ll post it in the comment. Every feedback given is welcomed. Even if it’s an idea, I’ll take it into consideration.
Thank you all in advance.