#I need help making this be able so nobody does commands in combat

1 messages · Page 1 of 1 (latest)

thorny basin
#

on damage:
attacker is a player
victim is a player

combat(victim)
combat(attacker)


if {combat.%{_p}%} is false:

    set {combat.cooldown.%{_p}%} to 15
    set {combat.%{_p}%} to true
    while {combat.cooldown.%{_p}%} is not 0:
    
        remove 1 from {combat.cooldown.%{_p}%}
        send action bar "&cIn Combat | %{combat.cooldown.%{_p}%}% Seconds Remain" to {_p}
        
        if {combat.cooldown.%{_p}%} is 0:
            set {combat.%{_p}%} to false
            
        wait 1 second
        
else:
    set {combat.cooldown.%{_p}%} to 15

on quit:
if {combat.%player%} is true:
kill player
set {combat.%player%} to false
set {combat.cooldown.%player%} to 0

on death:
set {combat.%victim%} to false
set {combat.cooldown.%victim%} to 0

merry chasm
#

is that AI

thorny basin
#

no

merry chasm
#

you never define the function combat(player)
you never define {_p}
you never do a on command: event

thorny basin
#

that skript works i just need help making it so people cant do commands

merry chasm
#

the combat variable should be a list, {combat::%player%}
(no need for uuids here)

merry chasm
#

on player death and on quit, the attacker stays in combat?

plain kite
#

Use lists and code blocks

plain kite
merry chasm
#

yeah that's what I'm wondering, it seems like it's missing code

plain kite
#

Also, delete the combat vars instead of setting to false, that way you dont have a bunch of old and useless stuff in storage

merry chasm
#

^^ pls yes
you don't want tens of thousands of variables like my first devs many years ago did

#

bro set 3 settings variables for every new on join, and my server got like 27k unique joins in 3 years, this was a lot of variables

hot kayak
#

just create the variable when they join and delete it when the leave o.O