How to Disable fighting between team mates using code

Ezolile

Member
Joined
May 19, 2023
Messages
40
It would be best to use variables because armor can receive damage and code will not read it properly. But if you want it to be armor do like this: Player Event Player damages player > If player is wearing [Damager] (red leather helmet) AND IF player is wearing [Victim] (red leather helmet) > Cancel event.
This should work.
To get damager and victim hold shift and right click on sign (if player is wearing).
And make sure you have nested if function. Consider these <> as pistons. Your code should look like:
player event player damages player If player is wearing [damager] > If player is wearing [victim] > Cancel event <<
 

ezezeez

Member
Joined
May 19, 2023
Messages
72
It would be best to use variables because armor can receive damage and code will not read it properly. But if you want it to be armor do like this: Player Event Player damages player > If player is wearing [Damager] (red leather helmet) AND IF player is wearing [Victim] (red leather helmet) > Cancel event.
This should work.
To get damager and victim hold shift and right click on sign (if player is wearing).
And make sure you have nested if function. Consider these <> as pistons. Your code should look like:
player event player damages player If player is wearing [damager] > If player is wearing [victim] > Cancel event <<
i mean you should use indestructible armour(which is ideal in team games) to use this code
 
Top