Custom Prison Enchantment Help

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

Lucky

Member
Oct 14, 2020
3
0
1
Hi I'm trying to make prison enchants and I started with the explosive enchant:

command explosive:
trigger:
give a diamond pickaxe with lore "&7Explosive I" to the player

on block break:
if "%region at event-block%" is "mine a":
if player is holding a diamond pickaxe with lore "&7Explosive I":
loop blocks in radius 2.5 of event-block:
add loop-block to {_explosive.%player%::*}
loop {_explosive.%player%::*}:
drop loop-value-1
set loop-block to air

So far this works, but when the pickaxe is used outside of the region it still works. I was wondering how I could make this only occur within the region and not allow blocks around the region to break. Currently when I use it in the region it can break blocks around the region that aren't supposed to be broken and the pickaxe still works when it isn't in the region so I would like to prevent both of those things from happening.

I am using Skript version 2.5-beta2-MH, WorldGuard version 7.0.5-SNAPSHOT+2076-60b16fc, and WorldEdit version 7.2.0-SNAPSHOP+5445-beb784e
[doublepost=1602985366,1602965616][/doublepost]Small update and Bump:

I redid some of the skript so now it looks like this:

command explosive:
trigger:
give a diamond pickaxe with lore "&7Explosive I" to the player

on block break:
if "%region at event-block%" contains "mine":
if player is holding a diamond pickaxe with lore "&7Explosive I":
loop all blocks in radius 2.5 around event-location:
add loop-block to {_explosive.%player%::*}
loop {_explosive.%player%::*}:
drop loop-value-1
set loop-block to air

This only allows it to work when it is in the region. My problem is the skript loops blocks outside of the region and removes them. Any help would be appreciated!

I am using Skript version 2.5-beta2-MH, WorldGuard version 7.0.5-SNAPSHOT+2076-60b16fc, and WorldEdit version 7.2.0-SNAPSHOP+5445-beb784e
[doublepost=1602986517][/doublepost]Ended Up Working with:

command explosive:
trigger:
give a diamond pickaxe with lore "&7Explosive I" to the player

on block break:
if "%region at event-block%" contains "mine":
if player is holding a diamond pickaxe with lore "&7Explosive I":
loop all blocks in radius 2.5 around event-location:
if "%region at loop-block%" contains "mine":
add loop-block to {_explosive.%player%::*}
loop {_explosive.%player%::*}:
drop loop-value-1
set loop-block to air
 
Status
Not open for further replies.