I'm trying to create a simple combat-log system for my server, but I cant seem to get it to work. I want it to send a message to the player in their action bar while they are in combat but it keeps throwing the error: "There's no player/console in a periodical event" Thanks in advance!
Code:
on join:
set {timer} to 0
set {combat} to false
on damage:
attacker is a player:
set {timer} to 10
every 1 seconds:
if {timer} is greater than 0:
set {combat} to true
else:
set {combat} to false
every 1 seconds in world "world":
loop all players:
if {combat.%loop-player%} is true:
subtract 1 from {timer.%loop-player%}
send action bar "&4You are in combat, don't log out! &4&l%{timer}% seconds remain" to %loop-player%
else: