combat.sk

Created by yea rite

Other available versions. Ordered by newest to oldest versions:

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

options:
  prefix: &kYour server here
#edit colors:
  1:&c⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
  2:&c⬛⬛⬛⬛⬛⬛⬛⬛⬛&f⬛
  3:&c⬛⬛⬛⬛⬛⬛⬛⬛&f⬛⬛
  4:&c⬛⬛⬛⬛⬛⬛⬛&f⬛⬛⬛
  5:&c⬛⬛⬛⬛⬛⬛&f⬛⬛⬛⬛
  6:&c⬛⬛⬛⬛⬛&f⬛⬛⬛⬛⬛
  7:&c⬛⬛⬛⬛&f⬛⬛⬛⬛⬛⬛
  8:&c⬛⬛⬛&f⬛⬛⬛⬛⬛⬛⬛
  9:&c⬛⬛&f⬛⬛⬛⬛⬛⬛⬛⬛
  10:&c⬛&f⬛⬛⬛⬛⬛⬛⬛⬛⬛


function combat(p: player):
  set {xcombat::%{_p}%} to 1
  set {_time} to now
  set {timecombat::%{_p}%} to now
  loop 10 times:
    if {xcombat::%{_p}%} = 1:
      send action bar "{@1}" to {_p}
    if {xcombat::%{_p}%} = 2:
      send action bar "{@2}" to {_p}
    if {xcombat::%{_p}%} = 3:
      send action bar "{@3}" to {_p}
    if {xcombat::%{_p}%} = 4:
      send action bar "{@4}" to {_p}
    if {xcombat::%{_p}%} = 5:
      send action bar "{@5}" to {_p}
    if {xcombat::%{_p}%} = 6:
      send action bar "{@6}" to {_p}
    if {xcombat::%{_p}%} = 7:
      send action bar "{@7}" to {_p}
    if {xcombat::%{_p}%} = 8:
      send action bar "{@8}" to {_p}
    if {xcombat::%{_p}%} = 9:
      send action bar "{@9}" to {_p}
    if {xcombat::%{_p}%} = 10:
      send action bar "{@10}" to {_p}
      send "{@prefix} &aYou are no longer combat" to {_p}
    {_time} = {timecombat::%{_p}%}
    add 1 to {xcombat::%{_p}%}
    wait 1 second

on damage of player:
  combat(attacker)
  combat(victim)
  damage cause is attack
  difference between {lastdamage::%victim%} and now >= 10 seconds:
    send "{@prefix} &cYou are now in combat" to victim
  difference between {lastdamage::%attacker%} and now >= 10 seconds:
    send "{@prefix} &cYou are now in combat" to attacker
  set {lastdamage::%victim%} to now
  set {lastdamage::%attacker%} to now

on disconnect:
  {xcombat::%player%} < 10
  kill player