On Damage GUI

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

    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.
Jul 15, 2018
19
1
3
Skript Version: Skript 2.2-dev27
Minecraft Version: 1.8-1.12

Okay, so, I want this skript and it says attacker cant be outside of a damage event! I don't know whats wrong, so please fix this. @ShaneBee

Full Code:
code_language.skript:
on damage:
    if attacker is a player:
        if victim is a player:
            cancel event
            create a gui with virtual chest named "&4&lAttacks" with 1 row:
                make gui slot 0 to diamond named "&4Punch" with lore "&cDamage&8: &65":
                    damage victim by 5 hearts
                    send "&4You punched %victim% by 5 hearts!" to attacker
                    send "&7+ &a10 Experience"
                    add 10 to {Exp.%attacker%}
                if {Lvl.%attacker%} is greater than 4:
                    make gui slot 1 to diamond named "&4Mega Punch" with lore "&cDamage&8: &68":
                        damage victim by 8 hearts
                        send "&4You MEGA Punched %victim% by 8 hearts!" to attacker
                        send "&7+ &a25 Experience"
                        add 25 to {Exp.%attacker%}
                if {Lvl.%attacker%} is greater than 7:
                    make gui slot 2 to diamond named "&4Slam" with lore "&cDamage&8: &610":
                        damage victim by 10 hearts
                        send "&4You slammed %victim% to the ground by 10 hearts!" to attacker

Errors on Reload:
Glitch11.PNG


Console Errors:
code_language.skript:
[None]

Addons using:
SkQuery, skUtilities, SkRayFall, Skellet, & Skript-Mirror

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? I have tried to put it in on click, that gave more errors.
 
why do you tag shane lol
 
lol why not just use this
code_language.skript:
on damage:
    if attacker is a player:
        if victim is a player:
            set {_victim} to victim
            set {_attacker} to attacker
            cancel event
            create a gui with virtual chest named "&4&lAttacks" with 1 row:
                make gui slot 0 to diamond named "&4Punch" with lore "&cDamage&8: &65":
                    damage {_victim} by 5 hearts
                    send "&4You punched %{_victim}% by 5 hearts!" to {_attacker}
                    send "&7+ &a10 Experience"
                    add 10 to {Exp.%{_attacker}%}
                if {Lvl.%{_attacker}%} is greater than 4:
                    make gui slot 1 to diamond named "&4Mega Punch" with lore "&cDamage&8: &68":
                        damage {_victim} by 8 hearts
                        send "&4You MEGA Punched %{_victim}% by 8 hearts!" to {_attacker}
                        send "&7+ &a25 Experience"
                        add 25 to {Exp.%{_attacker}%}
                if {Lvl.%{_attacker}%} is greater than 7:
                    make gui slot 2 to diamond named "&4Slam" with lore "&cDamage&8: &610":
                        damage {_victim} by 10 hearts
                        send "&4You slammed %{_victim}% to the ground by 10 hearts!" to {_attacker}
 
Status
Not open for further replies.