On place event

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

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

Tom1222322

Member
Feb 5, 2021
19
0
1
22
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:
on break:
    if "%region at player%" contains "minec":
    else:
        cancel event
        if player does not have permission "bes.build":
            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:
on place of birch log:
    if "%block under player%" is "iron block":
        message "test"
 
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:
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.
 
  • Like
Reactions: TehCheetah
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:
on break:
    if "%region at player%" contains "minec":
    else:
        cancel event
        if player does not have permission "bes.build":
            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:
on place of birch log:
    if "%block under player%" is "iron block":
        message "test"

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:
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/
 
Status
Not open for further replies.