Author Topic: Event_SetFriendlyFire [NOW for use with any minigame]  (Read 2092 times)

Requested here: http://forum.blockland.us/index.php?topic=294562.0

Includes one output event for players which allows you to enable (or disable) friendly fire between players.

Outputs:
Player:
setFriendlyFire <Default/ForceOff/ForceOn>

Has different functionality depending on whether or not it's a Slayer minigame.
Non-Slayer minigame:
If either the attacker or the victim have their state set to ForceOff, damage will not occur.
If both the attacker and the victim have their state set to ForceOn, damage will occur.
If one player is set to Default and the other is set to either ForceOn or Default, damage will be dealt according to the minigame's "Player" damage setting.

Slayer minigame:
If either the attacker or the victim have their state set to ForceOff, friendly fire will not occur.
If both the attacker and the victim have their state set to ForceOn, friendly fire will occur.
If one player is set to Default and the other is set to either ForceOn or Default, damage will be dealt according to the minigame's "Friendly Fire" setting.
This only applies to players on the same team (it might work with alliances as well but idk), and does not bypass the "Player" damage setting.

Download
Leopard Hosting
Glass (auto-updates)

Updates
March 26th, 2016 - Fixed an issue where never calling setFriendlyFire on a player would default them to ForceOff. Added regular minigame functionality.
NOTE: This update will break your events. Anything you had saved as ForceOff will be changed to Default, and anything set to ForceOn will be changed to ForceOff.
« Last Edit: July 11, 2016, 12:43:06 PM by Shift Kitty »

If I have the motivation, I'll modify it to work with standard minigames as well. While they don't have teams, it'll instead enable damage between players with player damage off, or disable damage players with player damage on.
yeah that'd be something i can use

Tested it on my server and it worked like a dime. Thanks again.  :cookieMonster:

Another add-on perfect for the masses. Thank you!

There's an error with this. Going to fix it along with adding the functionality for regular minigames.

If setFriendlyFire is never called on a player, they are ForceOff by default, due to "" == 0
« Last Edit: March 26, 2016, 08:07:54 PM by Shift Kitty »

March 26th, 2016 - Fixed an issue where never calling setFriendlyFire on a player would default them to ForceOff. Added regular minigame functionality.
NOTE: This update will break your events. Anything you had saved as ForceOff will be changed to Default, and anything set to ForceOn will be changed to ForceOff.

yeath this is something i will use

Brilliant! You can make easy PvE this way!

So uh....can this stop friendly bots from shooting me in the back every five seconds?

So uh....can this stop friendly bots from shooting me in the back every five seconds?
Sorry, this only changes interactivity between players.