I'm trying to make a good combattag skript and I have 3 ways, what do you think? or can you help me improve the script?
1.
2.
3.
1.
code_language.skript:
on damage of player:
set {combattag.%attacker%} to true
send "&cNow you have combattag."
wait 15 seconds
set {combattag.%attacker%} to true
send "&aNow you have no combattag."
on command:
{combattag.%player%} is true
cancel event
send "&cYou have combattag."
on quit:
{combattag.%player%} is true
kill player
set {combattag.%player} to false
on join:
set {combattag.%player%} to false
2.
code_language.skript:
on damage of player:
set {_time} to difference between {combattag.%player%} and now
on command:
if {_time} is less than 15 seconds:
send "&cYou have combattag."
cancel event
stop
set {combattag.%player%} to now
on quit:
if {_time} is less than 15 seconds:
kill player
stop
set {combattag.%player%} to now
on join:
delete {_time}
3.
code_language.skript:
on damage of player:
if {combattag::%player%} is not set:
set {combattag::%player%} to now
stop
set {_time} to difference between {combattag::%player%} and now
on command:
if {_time} is less than 15 seconds:
cancel event
set {_combattag} to 15 seconds
subtract {_time} from {_combattag}
send "&cYou have %{_combattag}% of combattag." to player
else:
set {combattag.%player%} to now
on quit:
if {_time} is less than 15 seconds:
kill player
set {_combattag} to 15 seconds
subtract {_time} from {_combattag}
else:
set {combattag.%player%} to now
on join:
delete {_time}