Help With Combat Code

I’m working on a multiplayer role-playing game presently in Unity. I want to do something (with the combat system) similar to Final Fantasy XI where only one player can engage a monster at a time. At the same time I’d like to make it so that other (aggressive) monsters can’t engage the player while the player is already in combat. The combat is turn-based real-time combat by the way. The code logic I’m having trouble figuring out is how to disable the ability for other monsters to engage the player, as well as the ability for other players to engage an already engaged monster. Any help?

I think the answer you are looking for is the bool.

True or False, the bool will allow an object to do a something or not.

if (playerEngaged)
return;

Just have a variable named, say, currentEnemy, and store a reference to the currently engaged enemy on both the player and the monster. Set it to null after combat, and when you attempt to initiate combat just check if currentEnemy == null.