No errors skript wont work

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

3dpixelartman

Member
Jun 23, 2021
23
0
1
24
Code:
on death of player:
    if attacker is a player:
        if player's max health is more than 1:
            if the max health of attacker >= 30:
                send "&c&lYou been killed by %attacker% and lost a heart" to victim
                subtract 1 from max health of player
                send "&cyou have the max hearts" to attacker
                wait 2 ticks
                if the max health of player <= 2:
                    send "&8[&bLifesteal&8] &cYou eliminated %player%" to attacker
                    broadcast "&8[&bLifesteal&8] &c%player% was ELIMINATED by %attacker%!"
                    wait 1 tick
                    ban player due to "&8[&bLifesteal&8] &cYou were ELIMINATED by %attacker%!" for 1 day
                    kick player due to "&8[&bLifesteal&8] &cYou have been ELIMINATED by %attacker%!"
                
            else:
                add 1 to max health of attacker
                send "&c&lYou been killed by %attacker% and lost a heart" to victim
                subtract 1 from max health of player
                wait 2 ticks
                if the max health of player <= 0.5:
                    send "&8[&bLifesteal&8] &cYou eliminated %player%" to attacker
                    broadcast "&8[&bLifesteal&8] &c%player% was ELIMINATED by %attacker%!"
                    wait 1 tick
                    ban player due to "&8[&bLifesteal&8] &cYou were ELIMINATED by %attacker%!" for 1 day
                    kick player due to "&8[&bLifesteal&8] &cYou have been ELIMINATED by %attacker%!"

    else:
        subtract 1 from max health of player
        wait 2 ticks
        if the max health of player <= 0.5:
            send "&8[&bLifesteal&8] &cYou eliminated %player%" to attacker
            broadcast "&8[&bLifesteal&8] &c%player% was ELIMINATED by %attacker%!"
            wait 1 tick
            ban player due to "&8[&bLifesteal&8] &cYou were ELIMINATED by %attacker%!" for 1 day
            kick player due to "&8[&bLifesteal&8] &cYou have been ELIMINATED by %attacker%!"

            
command /withdraw:
    trigger:
        if the max health of player >= 2:
            give player 1 of red dye named "&c♥♥♥HEART♥♥♥"
            subtract 1 from max health of player
        else:
            send "&cYou dont have the amount of hearts needed to withdraw this"
            
on right click with red dye:
    if name of player's tool is "&c♥♥♥HEART♥♥♥":
        if the max health of player >= 30:
            send "&cSorry but you have the max amount of hearts"
            remove 1 red dye named "&c♥♥♥HEART♥♥♥" from player
        else:
            add 1 to max health of player
            send "&aYou redeemed a heart"
            remove 1 red dye named "&c♥♥♥HEART♥♥♥" from player

on load:
    set {_heart} to red dye named "&c♥♥♥HEART♥♥♥"
    register new shaped recipe for {_heart} named "&c♥♥♥HEART♥♥♥" using emerald block, diamond block, emerald block, diamond block, totem of undying, diamond block, emerald block, diamond block and emerald block with id "heart"
I got the owner to put the skript in, reload it, screen share how they did it, let me reload it and other skripts still work. For some reason the skript will reload with no errors but nothing in it will work
 
Line 3: if player's max health is more than 1: Use attacker and/or victim in damage/death events.
Line 29: subtract 1 from max health of player: Use attacker and/or victim in damage/death events.
Line 31: if the max health of player <= 0.5: Use attacker and/or victim in damage/death events.
Line 59: Using skBee the following code should work on 1.19. Make sure you get the correct skBee version tho!
Code:
on skript load:
    set {_heart} to red dye named "&c♥♥♥HEART♥♥♥"
    register new shaped recipe for {_heart} using emerald block, diamond block, emerald block, diamond block, totem of undying, diamond block, emerald block, diamond block and emerald block with id "heart"

Also, keep in mind that "on skript load" means you have to restart the server everytime you change te recipe.
 
Status
Not open for further replies.