Combat Skript

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

MrAtheerNo_

Member
Feb 6, 2022
1
0
1
23
hey i am trying to find a combat skript where people cant get in spawn if they are in combat, im trying to make a dupe server thats why i need it
please help me
 
Code:
on damage:
    victim is player
    attacker is player
    set {combatlog::%victim%} to 10
    set {combatlog::%attacker%} to 10
    send "&bCombatLog &8| &7You are now in combat log! Do not log out!" to player
on join:
    if {combatlog::%player%} > 0:
        kill the player
every 0.5 seconds:
    if {combatlog::%player%} =< 0:
        send "&bCombatLog &8| &7You can safely log off now." to player
        set {combatlog::%player%} to -0.5
    else:
        remove 0.5 from {combatlog::%player%}
on command:
    if {combatlog::%player%} > 0:
        cancel event
        send "&bCombatLog &8| &7You cannot use commands while your in combat!" to player
 
what are your errors? take a screen shot of the errors and put it here.
then people can actually help you
 
Hey you cannot every 0.5 seconds in %player% expre.
You can only loop all players but i founded like this


Code:
function checkCombot(p: player) :: boolean:
 if (difference between {combatlog::%{_p}%} and now) <= 10 seconds:
  return true
 return false
 
on damage of player:
 if damage cause is an player:
  set {combatlog::%victim%} and {combatlog::%attacker%} to now
  send "&bCombatLog &8| &7You are now in combat log! Do not log out!" to the victim
   
on disconnect:
 if checkCombot(event-player) is true:
  kill event-player

on command:
 if checkCombot(event-player) is true:
  cancel event
  send "&bCombatLog &8| &7You cannot use commands while your in combat!" to player
 
Status
Not open for further replies.