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!

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

Solved Combat Log

Discussion in 'Requests' started by Adrihun, Feb 2, 2017.

  1. Adrihun

    Adrihun Member

    Joined:
    Feb 1, 2017
    Messages:
    368
    Likes Received:
    6
    Category: Combat - Skript

    Suggested name: Combat Log

    What I want:
    I want a simple one that makes it so in when you hit someone, the victim gets a message in chat saying "You have been hit, Don't log out - 10 seconds left" if they log out in that 10 seconds, and log back in, they will die for Combat Logging. If the timer goes to 0, it will say "You can safely log out now"

    Ideas for commands:
    No Commands

    Ideas for permissions:
    No Permissions

    When I'd like it by: Asap - Please
    --- Double Post Merged, Feb 2, 2017, Original Post Date: Feb 2, 2017 ---
    bump
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Code (Skript):
    1. on damage:
    2.     victim is player
    3.     attacker is player
    4.     send "&cYou've been hit, Don't Logout - 10 Seconds left -" to victim
    5.     set {%attacker%.log} to true
    6.     wait 10 seconds
    7.     set {%attacker%.log} to false
    8.     send "&cYou can &lsafely &cLog out now."
    9.  
    10. on quit:
    11.     victim is player
    12.     if {%attacker%.log} is true:
    13.         kill player
    14.         broadcast "&c%victim% has logged out while in combat tag!"
    15.  
    16.  
    17.  
    18.    
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    One of the frist Skripts I ever made. Wonder if it still works:

    Code (Skript):
    1.  
    2. #
    3. # AntiPvpLog
    4. #
    5. # When a player logs out while he/she is in PvP, he/she will be killed and tempbanned
    6. #
    7. # Author: GeekWithAChick
    8. # Version: 1.1
    9. #
    10. on damage of player:
    11.     attacker is player
    12.     if {pvplog.%attacker%} is not set:
    13.         send "&7[&6ES&7] &bYou are now in &6PvP&b, don't log out!" to attacker and victim
    14.     set {pvplog.%attacker%} to true
    15.     set {pvplog.%victim%} to true
    16.     set {pvplog.%attacker%.lastused} to now
    17. #
    18. # Replace 100 and 99 ticks if you want to change the time of PvP. 20 ticks is 1 second
    19. #
    20.     wait 100 ticks
    21.     if {pvplog.%attacker%.lastused} was more than 99 ticks ago:
    22.         send "&7[&6ES&7] &bYou are no longer in  &6PvP&b. You can log out safely now." to attacker and victim
    23. # This deletes the variables because they are no longer needed and local variables are not an option.
    24.         delete {pvplog.%attacker%}
    25.         delete {pvplog.%victim%}
    26.         delete {pvplog.%attacker%.lastused}
    27.  
    28. on quit:
    29.     {pvplog.%player%} is true:
    30.         broadcast "&7[&6ES&7] &b%player% was pvp-logging"
    31.         kill player
    32.         set {pvp.logger.%player%} to true
    33. on join:
    34.     {pvp.logger.%player%} is true
    35.     send "&7[&6ES&7] &bYou were killed for pvp-logging"
    36.     delete {pvp.logger.%player%}
    37.  
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220

Share This Page

Loading...