Solved Combat Log

  • 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!

Adrihun

Member
Feb 1, 2017
368
6
0
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
[doublepost=1486068973,1485994964][/doublepost]bump
 
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
[doublepost=1486068973,1485994964][/doublepost]bump
code_language.skript:
on damage:
    victim is player
    attacker is player
    send "&cYou've been hit, Don't Logout - 10 Seconds left -" to victim
    set {%attacker%.log} to true
    wait 10 seconds
    set {%attacker%.log} to false
    send "&cYou can &lsafely &cLog out now."

on quit:
    victim is player
    if {%attacker%.log} is true:
        kill player
        broadcast "&c%victim% has logged out while in combat tag!"
 
One of the frist Skripts I ever made. Wonder if it still works:

code_language.skript:
#
# AntiPvpLog
#
# When a player logs out while he/she is in PvP, he/she will be killed and tempbanned
#
# Author: GeekWithAChick
# Version: 1.1
#
on damage of player:
    attacker is player
    if {pvplog.%attacker%} is not set:
        send "&7[&6ES&7] &bYou are now in &6PvP&b, don't log out!" to attacker and victim
    set {pvplog.%attacker%} to true
    set {pvplog.%victim%} to true
    set {pvplog.%attacker%.lastused} to now
#
# Replace 100 and 99 ticks if you want to change the time of PvP. 20 ticks is 1 second
#
    wait 100 ticks
    if {pvplog.%attacker%.lastused} was more than 99 ticks ago:
        send "&7[&6ES&7] &bYou are no longer in  &6PvP&b. You can log out safely now." to attacker and victim
# This deletes the variables because they are no longer needed and local variables are not an option.
        delete {pvplog.%attacker%}
        delete {pvplog.%victim%}
        delete {pvplog.%attacker%.lastused}
 
on quit:
    {pvplog.%player%} is true:
        broadcast "&7[&6ES&7] &b%player% was pvp-logging"
        kill player
        set {pvp.logger.%player%} to true
on join:
    {pvp.logger.%player%} is true
    send "&7[&6ES&7] &bYou were killed for pvp-logging"
    delete {pvp.logger.%player%}