Bomb skript on right click doesn't 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!

Xofays

Member
Jan 18, 2024
4
0
1
23
I tried to create a skirpt that adds a bomb but when you place it and press right button with the stick it should explode in a few seconds but it doesn't work and I don't know why
Code:
command /bomb:
    trigger:
        give player 1 white glazed terracotta named "&5&lBOMBA"
        give player 1 stick named "&cBotton Bomba"

on place white glazed terracotta:
    if name of player's tool is "&5&lBOMBA":
        if {bomba:emoji_stuck_out_tongue:laced} isn't set:
            set {bomba:emoji_stuck_out_tongue:laced} to "true"
            send action bar "&aHai attivato questa bomba correttamente!" to player
            stop

on right click with stick:
    if name of tool of player is "&cBotton Bomba":
        if {bomba:emoji_stuck_out_tongue:laced} is set:
            if {bomba::esplode} isn't set:
                if name of block is "&5&lBOMBA":
                    if event-block is white glazed terracotta:
                        set {bomba::esplode} to "true"
                        send action bar "&aHai azionato la bomba correttamente!" to player
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        create an explosion of force 10 at location of block
                        wait 1 seconds
                        set {bomba::esplode} to "false"
                        set {bomba:emoji_stuck_out_tongue:laced} to "false"
                        stop
here is the skript if someone can help me
 
Last edited by a moderator:
what do you mean
The reason your code had :emoji_stuck_out_tongue: in it. If you put it in code blocks by clicking the </> icon in the toolbar of where you type, it'll stop emojis from appearing.
 
Code:
like this?

command /bomb:
    trigger:
        give player 1 white glazed terracotta named "&5&lBOMBA"
        give player 1 stick named "&cBotton Bomba"

on place white glazed terracotta:
    if name of player's tool is "&5&lBOMBA":
        if {bomba::placed} isn't set:
            set {bomba::placed} to "true"
            send action bar "&aHai attivato questa bomba correttamente!" to player
            stop

on right click with stick:
    if name of tool of player is "&cBotton Bomba":
        if {bomba::placed} is set:
            if {bomba::esplode} isn't set:
                if name of block is "&5&lBOMBA":
                    if event-block is white glazed terracotta:
                        set {bomba::esplode} to "true"
                        send action bar "&aHai azionato la bomba correttamente!" to player
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        play sound "minecraft:entity.generic.extinguish_fire" with volume 5 to the player
                        wait 1 seconds
                        create an explosion of force 10 at location of block
                        wait 1 seconds
                        set {bomba::esplode} to "false"
                        set {bomba::placed} to "false"
                        stop

can you try the script and look what is wrong with it and fix it i tried but it doesn't work
 
Last edited:
Yep. Although you don't need to put your entire post in that code section, just the code itself.
I'm pretty sure name of block in your right click event is probably where it's not working. A good tip is try debugging by messaging what the if is. So:
Code:
on right click with stick:
    message "name of tool: %name of tool of player%"
    if name of tool of player is "&cBotton Bomba":
        message "bomba::placed: %{bomba::placed}%"
        if {bomba::placed} is set:
            message "bomba::esplode: %{bomba::esplode}%"
            if {bomba::esplode} isn't set:
                message "name of block: %name of block%"
                if name of block is "&5&lBOMBA":
                    message "event-block: %event-block%"
                    if event-block is white glazed terracotta:
                        message "successfully made it past ifs"
Then when you run the event, you can see what might be stopping the code from working.