AIGLE25 Posted November 12, 2023 Share Posted November 12, 2023 (edited) hello , i need to add region check to my script but i tried a lot of stuff but won't work : on place of sponge: if "block under event-location" is air or sponge: cancel event if possible i want it handles duplicate region names in different worlds and with permission luckyblock.place like this script: # Configuration options: permission: "sponge.place" canPlaceOutsideRegion: true # Dependencies: WorldGuard # Code on place of sponge: event isn't cancelled # Permission check if player doesn't have permission {@permission}: cancel event send "<red>You do not have permission to do this!" exit # Region check set {_regions::*} to regions at event-location if {_regions::*} is empty: delete {_regions::*} if {_regions::*} is not set: if {@canPlaceOutsideRegion} is true: exit cancel event send "<red>You can not place sponge here!" exit # Loop over regions, this will handle overlapping regions loop {_regions::*}: set {_id} to loop-value if {sponge::%{_id}%::%player's uuid%} is not set: set {sponge::%{_id}%::%x coordinate of event-location%_%x coordinate of event-location%_%x coordinate of event-location%} to player's uuid set {sponge::%{_id}%::%player's uuid%} to "%x coordinate of event-location%_%x coordinate of event-location%_%x coordinate of event-location%" exit send "<red>You have already placed sponge in this region!" cancel event on break of sponge: event isn't cancelled set {_regions::*} to regions at event-location loop {_regions::*}: set {_id} to loop-value # Has a player placed this sponge if {sponge::%{_id}%::%x coordinate of event-location%_%x coordinate of event-location%_%x coordinate of event-location%} is set: # Has this player placed the sponge if {sponge::%{_id}%::%player's uuid%} is "%x coordinate of event-location%_%x coordinate of event-location%_%x coordinate of event-location%": delete {sponge::%{_id}%::%x coordinate of event-location%_%x coordinate of event-location%_%x coordinate of event-location%} delete {sponge::%{_id}%::%player's uuid%} exit send "<red>That isn't your sponge!" cancel event exit i'm using skript 2.6.5 Edited November 13, 2023 by AIGLE25 Link to comment Share on other sites More sharing options...
DanRub Posted November 13, 2023 Share Posted November 13, 2023 Im little bit lost about what you want, but if you need check region of player you can do it like this: if "%region at player%" contains "test": #rest of your code Link to comment Share on other sites More sharing options...
AIGLE25 Posted November 13, 2023 Author Share Posted November 13, 2023 (edited) i forgot to mark it as solved but i had to remove the if and use %region at event-location% on right click: "%region at event-location%" contains "test" if targeted block is sponge: cancel event and how can i mark as solved ? Edited November 13, 2023 by AIGLE25 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now