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!


    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.

On place event

Discussion in 'Skript' started by Tom1222322, Feb 5, 2021.

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

    Tom1222322 Member

    Feb 5, 2021
    Likes Received:
    Hello, I've two questions regarding this event so first:

    How can I configure it so I could break blocks in a specific region but nowhere else? my code:
    Code (Text):
    1. on break:
    2.     if "%region at player%" contains "minec":
    3.     else:
    4.         cancel event
    5.         if player does not have permission "bes.build":
    6.             cancel event
    Second question:
    How can I configure this event as well so if I place for example birch log on an iron block it would give me a diamond? My code:
    Code (Text):
    1. on place of birch log:
    2.     if "%block under player%" is "iron block":
    3.         message "test"
  2. FireRoz

    FireRoz Active Member

    May 28, 2020
    Likes Received:
    i would like to explain something.
    first of all, %region at player% is not a thing, it's %player's region% and another thing, you can't tell skript to do nothing, you need to set something. so if you want to tell it to do nothing, you'd simply add "stop".
    also, using "" doesn't work like that. if you wanna use quotes then you're saying that this is custom. %block under player% shouldn't be a thing, it should be
    Code (Text):
    1. if block under player:
    same goes for the iron block.
    I would usually give people the full code, but I'm tryna help people. I feel like in this situation, helping would be explaining to you without giving the full solution to make you a better coder.
    TehCheetah likes this.
  3. TehCheetah

    TehCheetah Member

    Feb 7, 2021
    Likes Received:
    Many things here.

    - Its %player's region
    - instead of cancel event here, you'd use stop.
    - %block under player% doesn't exist! Try doing
    Code (Text):
    1. if block under player:
    - There are many instances where you are trying to end the code without doing anything. Again, try stop.

    When Skripting, try looking over the documentations. There are a few out there which would help, so I'll list a few for you!

    - https://skriptlang.github.io/Skript/index.html

    - https://en.njol.ch/projects/skript/doc

    - https://docs.skunity.com/syntax/
Thread Status:
Not open for further replies.

Share This Page