#On death of player repeats output two times while it should not
1 messages · Page 1 of 1 (latest)
on death of player:
wait 1 tick
if {warsession} is true: # If war is enabled
if {war.attacker.players::*} contains attacker: # If event-attacker is part of the attacker side
# {war.attacker.ticket} -> Attacker side life tickets
# {war.defender.ticket} -> Defender side life tickets
broadcast "DEBUG 2 if {war.attacker.players::*} contains attacker"
if {war.defender.players::*} contains victim: # If event-victim is part of the defender side
if {war.defender.ticket} > 0: # If defender side has more than 0 life tickets
broadcast "DEBUG 3 if {war.defender.ticket} > 0"
remove 1 from {war.defender.ticket} # Remove one life ticket from victim side
update score in group id "defender4" to "&8>>" and 0
update score in group id "defender5" to "&8>> &aLife Tickets: %{war.defender.ticket}%" and 0
broadcast "DEBUG 4 %{war.defender.ticket}%"
else if {war.defender.ticket} = 0: # If side has terminated the life tickets
set {warend} to true # Set variable for war ending
set {warwinner} to first element of {war.attacker::*}
set {warloser} to first element of {war.defender::*}
execute command "/warend" # Trigger war ending
Apparently, on death of player condition repeats two times, i don't understand why?
technically from my code, it should remove 1 score if x player dies killed by the other team, and it works
but it gets repeated two times for some unknown reason
well you dont have any loops in that code
so maybe you possibly have another section of code that does that on death?
nope i don't
Add a broadcast under a new death event
If thats broadcasting twice then maybe you cancel death and the kill?
Have you tried a restart?
on death of player:
broadcast "test"
yeah of course
how do i do this?
maybe you have a plugin that modifies deaths
like auto respawn or something
or maybe you have an outdated addon
why are you on a pre release