Solved make console execute command

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

zanexGHG

Member
Nov 12, 2022
2
0
1
18
So ive been trying to make a skript where if a player dies he loses a heart and if he lost all his hearts he will get banned but somehow if I use this method:
Code:
on death of player:
    if attacker is a player:
        if health of victim <= 0:
            make console execute command: "/kick %victim% reason:&4&l&kHH&c&lYOU LOST ALL OF YOUR HEARTS!!!&4&l&kHH&r"
        else:
            add 1 to attacker's max health
            remove 1 from victim's max health
            wait 10 ticks
            message "&c&lYou lost a heart due to dying!!!" to victim
            message "&a&lYou have gained a heart due to killing %victim%!!!" to attacker
    else:
        remove 1 from victim's max health
        wait 10 ticks
        message "&c&lYou lost a heart due to dying!!!" to victim
it gives me an ingame error:
Capture.PNG
 
well the thing is this doesnt work first of all i cant use the variable %player% in the command i have to use %victim% and no matter what i use if its execute console command or make victim execute command it doesnt work
[doublepost=1668260819,1668251676][/doublepost]Found a method!!!
Code:
if max health of victim is less than 1:
        wait 10 ticks
        execute console command "/kick %victim% &c&lYOU LOST ALL OF YOUR HEARTS!!!"
 
Status
Not open for further replies.