1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to allow block place on certain blocks only?

Discussion in 'Skript' started by JustADev, Jul 29, 2017.

Thread Status:
Not open for further replies.
  1. JustADev

    JustADev Well-Known Member

    Joined:
    Apr 8, 2017
    Messages:
    380
    Likes Received:
    9
    Can anyone tell me how to allow block placing on certain blocks? Like on Endstone, Nether rack, etc?
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Code (Skript):
    1.  
    2. on place:
    3.     target block is not end stone or netherrack
    4.     cancel event
    5.  
    Something like this?
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Check the even-block, I believe maybe something like this. the syntax may be a bit off
    Code (Skript):
    1. on place:
    2.     if event-block is not obsidian:
    3.         cancel event
    4.  
    --- Double Post Merged, Jul 29, 2017, Original Post Date: Jul 29, 2017 ---
    oof just a second too late x3
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    What i meant to say is that to overide world guard regions to place oak logs and oak planks
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    I don't know if this will bypass WG but give it a shot
    Code (Skript):
    1. on place:
    2.     if "%region%" is "YourRegionHere in world world":
    3.         if player is holding planks:
    4.             set event-block to planks
    5.         if player is holding oak log:
    6.             set event-block to log
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    That didnt work hmmm
     
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    idk how worldguard works but it might be cancelling the event so on place will never fire
     
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    hmm, so what should i make it to?
     
  9. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    You may be better off just using WG itself. I do believe it has per block permission if memory serves. they're a bit tedious though.
    What might be even easier is just allowing people to build in a region with WG and then using skript to determine where they can't
     
  10. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Try using the on can build check event instead as the block technically isn't being placed like so:

    Code (Skript):
    1.  
    2. on can build check:
    3.     if "%region%" is "YourRegionHere in world world":
    4.         if player is holding planks:
    5.             set event-block to planks
    6.         if player is holding oak log:
    7.             set event-block to log
    8.  
     
    #10 ShaneBee, Jul 29, 2017
    Last edited by a moderator: Jul 29, 2017
Thread Status:
Not open for further replies.

Share This Page

Loading...