Instant explode TnT

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

JustADev

Well-Known Member
Apr 8, 2017
379
9
18
22
Question: How do I make it so that when you right click TNT, it will instantly explode where you place it?

CODE:
code_language.skript:
on right click with TNT:
    name of player's tool is "&cExplosive TNT &7(Right Click)":
    create a fake explosion at the player
    spawn a primed tnt at the player
 
Question: How do I make it so that when you right click TNT, it will instantly explode where you place it?

CODE:
code_language.skript:
on right click with TNT:
    name of player's tool is "&cExplosive TNT &7(Right Click)":
    create a fake explosion at the player
    spawn a primed tnt at the player
Idk if this works but give it a shot. my syntax may be off
code_language.skript:
on right click:
    if event-block is tnt:
        set event-block to primed tnt
 
Primed TNT is an entity , not a block so:
code_language.skript:
set block at event-block to air
spawn primed tnt at event-block
 
Well, basically, all i want is that, when you place tnt down with right click, it will instantly cause an explosion when the tnt hits the ground
 
code_language.skript:
on place of TNT:
    cancel the event
    remove 1 TNT from player's inventory
    spawn 1 primed TNT at event-location
 
Skellett needed:
code_language.skript:
set the fuse time of last spawned primed tnt to 200 #time in ticks
[doublepost=1501541820,1501541790][/doublepost]
you could skip the setting primed tnt step and just make an explosion instead
It will not make the same animation :emoji_stuck_out_tongue:
 
So where do i put it?
Just something to help figure out where things go in the future:
skript will always read from top to bottom until it hits a stopping point. so in this case, in order to set the timer of a spawned prime tnt, you need it to be spawned first. so spawn --> effect.
 
Ok I changed it to this:
CODE:
code_language.skript:
on place of TNT:
    cancel the event
    remove 1 TNT from player's inventory
    spawn 1 primed TNT at event-location
    set fuse time of last spawned primed tnt to 200

But the tnt still doesnt insta explode, it removed the error though
 
Ok I changed it to this:
CODE:
code_language.skript:
on place of TNT:
    cancel the event
    remove 1 TNT from player's inventory
    spawn 1 primed TNT at event-location
    set fuse time of last spawned primed tnt to 200

But the tnt still doesnt insta explode, it removed the error though

200 are the ticks , put them to 1
 
Ok, I found it out.. I fixed it:

CODE:
code_language.skript:
on place of TNT:
    cancel the event
    remove 1 TNT from player's inventory
    spawn 1 primed TNT at event-location
    set fuse time of the last spawned primed TNT to 0

Now how do I disable block dmg for it?
 
Status
Not open for further replies.