piece of code not working

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

titustitus98

Member
Feb 19, 2018
47
0
6
25
Hi so I made this skript to do so that when I click on a chest with a crate key some stuff will happen but for somereason all it does is launch the firework, how can I fix that?

Code:
on right-click:
    if location of target block is location( -16.5, 67.5, -2.5, world "earth"):
        if player's tool is glowing tripwire hook named "&7Rankup Crate Key" with lore "&6Right-Click on a crate to use":
            cancel event
            launch "BURST" firework at location of event-block with timed -1
            remove 1 of glowing tripwire hook named "&7Rankup Crate Key" with lore "&6Right-Click on a crate to use" from player's inventory
            set {reward.%player%} to random integer between 1 and 4
            if {reward.%player%} is "1":
                send "&6&lCrates&8: &7Congratulations &e%player%&7! &7You have won &9100'000$"
                add 100000 to player's balance
                stop
            else if {reward.%player%} is "2":
                send "&6&lCrates&8: &7Congratulations &e%player%&7! You have won &95'000 coins"
                add 5000 to {coins::%player's uuid%}
                stop
            else if {reward.%player%} is "3":
                send "&6&lCrates&8: &7Congratulations &e%player%&7! &7You have won &91'000'000$"
                add 1000000 to player's balance
                stop
            else if {reward.%player%} is "4":
                send "&6&lCrates&8: &7Congratulations &e%player%&7! You have won &910'000 coins"
                add 10000 to {coins::%player's uuid%}
                stop
Also I figured out that the code stops working after "launch "BURST" firework at location of event-block with timed -1"
 
Status
Not open for further replies.