1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I need help with my code!

Discussion in 'Skript' started by AlixPlayz, May 29, 2019.

Thread Status:
Not open for further replies.
  1. AlixPlayz

    AlixPlayz Member

    Joined:
    May 28, 2019
    Messages:
    4
    Likes Received:
    0
    I am trying to make a combatlog script for my server. I managed to do the combatlogging part but I wanted to make a command which you can disable/enable logging for people with the right permission and thats the part that i need help with.

    Code (Text):
    1. on damage of player:
    2.     attacker is a player
    3.     if {combat.tag::%attacker%} is false:
    4.         send "&cYou entered combat. Don't log out for 10 seconds." to attacker
    5.         set {combat.tag::%attacker%} to true
    6.     if {combat.tag::%victim%} is false:
    7.         send "&cYou entered combat. Don't log out for 10 seconds." to victim
    8.         set {combat.tag::%victim%} to true
    9.     wait 15 seconds
    10.     set {combat.tag::%attacker%} to false
    11.     set {combat.tag::%victim%} to false
    12.  
    13. on command:
    14.     command is equal to "spawn", "warp", "tpa", "mine" or "home"
    15.     if {combat.tag::%player%} is true:
    16.         message "&cTeleporting is disabled while in combat."
    17.         cancel event
    18.      
    19. On quit:
    20.     if {combat.tag::%player%} is true:
    21.         set {tag.combat::%player%} to true
    22.         kill player
    23.        
    24. On join:
    25.     if {tag.combat::%player%} is true:
    26.     wait 2 seconds
    27.     send "&cYou logged out during combat and were killed."
    28.     set {tag.combat::%player%} to false
    29.    
    30. command /combatlog <text>:
    31.     aliases: /cbl, /cblog, /clog
    32.     usage: /combatlog [on/off]
    33.     permission: combatlog.bypass
    34.     permission message: &cYou don't have the required permission to perform that command.
    35.     trigger:
    36.         send "&aYou have not turned combatlogging %arg 1%"
    37.         if %arg 1% is equal to "on":
    38.             if {combat.tag::%player%} is true:
    39.                 set {combat.tag::%player%} to false
    40.             if {tag.combat::%player%} is true:
    41.                 set {tag.combat::%player%} to false
    42.         if %arg 1% is equal to "off":
    43.             stop trigger
     
  2. Joni

    Joni Member

    Joined:
    Jan 5, 2019
    Messages:
    25
    Likes Received:
    0
    Code (Text):
    1. on damage of player:
    2.     if attacker is a player:
    3.         if {combat.tag::%attacker%} is false:
    4.             send "&cYou entered combat. Don't log out for 10 seconds." to attacker
    5.             set {combat.tag::%attacker%} to true
    6.             wait 15 seconds
    7.         if {combat.tag::%victim%} is false:
    8.             send "&cYou entered combat. Don't log out for 10 seconds." to victim
    9.             set {combat.tag::%victim%} to true
    10.         if {combat.tag::%attacker%} is not set:
    11.             send "&cYou entered combat. Don't log out for 10 seconds." to attacker
    12.             set {combat.tag::%attacker%} to true
    13.         if {combat.tag::%victim%} is not set:
    14.             send "&cYou entered combat. Don't log out for 10 seconds." to victim
    15.             set {combat.tag::%victim%} to true
    16.         wait 15 seconds
    17.         set {combat.tag::%attacker%} to false
    18.         set {combat.tag::%victim%} to false
    19. on command:
    20.     if command contains "spawn", "home", "warp", "tpa" or "mine":
    21.         if {combat.tag::%player%} is true:
    22.             cancel event
    23.             send "&cTeleporting is disabled while in combat."
    24. on quit:
    25.     if {combat.tag::%player%} is true:
    26.         set {tag.combat::%player%} to true
    27.         set {combat.tag::%player%} to false
    28. on join:
    29.     if {tag.combat::%player%} is true:
    30.         wait 3 seconds
    31.         kill player
    32.         send "&cYou logged out during combat and were killed."
    33.         set {tag.combat::%player%} to false
    I think the command is right, but if its not, let me know. Glad i could help :emoji_slight_smile:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...