Jump to content

can someone help me with a combat log skript?


Legendary_Edwin

Recommended Posts

On damage of a player, set both the attacker's and the victim's Combat variable to true. After that, use the on quit event to check if the player's combat variable was true. If so, delete the variable, then kill the player. On command, check if the player's combat variable is true. If so, cancel event.

rose city STICKER

RosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaRosaR

i code, animate, develop, UI design, learn, and adapt, as well as make servers, of course

💐Joined Minehut sometime in 2014
💐VIP sometime in 2018
💐Legend in January 2021
💐Helper on 4/11/2021
💐♥ (Retired) on 5/17/2021
💐 Moderator on 8/18/2023

Link to comment
Share on other sites

On 10/18/2021 at 5:47 PM, Legendary_Edwin said:

i want so that when someone gets hit they can't log out or they die, and they won't be able to use commands in combat

Here is a skript for you just incase you need it:

 

command /setspawn:
    permission: Admin.staff
    permission message: &9Permissions> &7You do not have permission to do that.
    trigger:
        set {global.spawn} to player's position
        send "&bSpawn &7| &7The Survival Spawn has been set."

command /spawn:
    trigger:
        set {_spawnd} to difference between {spawn.%player's uuid%.lastused} and now
        if {_spawnd} is less than 5 seconds:
            message "&bSpawn &7| &7You cannot use this command &7for '&b%difference between 5 seconds and {_spawnd}%&7'."
            stop
        if {combatlog.%player's uuid%} is higher than 0:
            send "&bSpawn &7| &7You are still in combat!"
            stop
        else:
            if {global.spawn} is set:
                teleport player to {global.spawn}
                set {spawn.%player's uuid%.lastused} to now
                send "&bSpawn &7| &7You were teleported to Spawn!"
            else:
                if player has permission "Admin":
                    send "&bSpawn &7| &7There is no spawn. Create one using &7'&b/setspawn&7'"
                else:
                    send "&bSpawn &7| &7There was an error accessing your order."
on damage:
    if attacker is a player:
        if victim is a player:
            set {combat.%victim's uuid%} to true
            set {combat.%attacker's uuid%} to true
            set {combatlog.%victim's uuid%} to 20
            set {combatlog.%attacker's uuid%} to 20
            send action bar "&7Log timer: &b%{combatlog.%victim's uuid%}%" to victim
            send action bar "&7Log timer: &b%{combatlog.%attacker's uuid%}%" to attacker
            
every 2 second:
    loop all players:
        if {combat.%loop-player's uuid%} = true:
            if {combatlog.%loop-player's uuid%} is higher than 0:
                remove 2 from {combatlog.%loop-player's uuid%}
                send action bar "&7Log timer: &b%{combatlog.%loop-player's uuid%}%" to loop-player    
            else:
                clear {combat.%loop-player's uuid%}
            
            
        
                

Link to comment
Share on other sites

  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...