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.

Solved Unplaceable Block

Discussion in 'Skript' started by ElementAstronaut, May 11, 2022.

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

    Joined:
    May 11, 2022
    Messages:
    11
    Likes Received:
    1
    How do I make a block unplaceable, and not conflict with my other code? My current code looks like this:

    on right click with beacon:
    if name of tool of player is "&b&lRevive Beacon":
    send "&aRight Click Works!"
    subtract 1 of beacon named "&b&lRevive Beacon" from player's inventory

    on place of beacon:
    if name of tool of player is "&b&lRevive Beacon":
    send "&4You can't place that block!"
    cancel event

    It works if you have over 3 revive beacons, but if you only have either one or two, the beacon will still place.
     
  2. Best Answer:
    Post #2 by Practice, May 11, 2022
  3. Practice

    Practice Member

    Joined:
    Apr 23, 2022
    Messages:
    37
    Likes Received:
    1
    Cancel the right click event and remove the place event.
    Code (Text):
    1. on right click with beacon:
    2.     if name of tool of player is "&b&lRevive Beacon":
    3.         cancel event
    4.         remove 1 beacon named "&b&lRevive Beacon" from player's inventory
     
    • Agree Agree x 1
  4. ElementAstronaut

    Joined:
    May 11, 2022
    Messages:
    11
    Likes Received:
    1
    That works like a charm! Thank you so much!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...