so uh yea idk how to do this

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

    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!

Aug 18, 2023
18
1
3
so im making a thing where if you right click on a green concrete you only get it if you are the one who placed it but it gets an error.
Heres my code:
Code:
on right click:
    if clicked block is green concrete:
        if player placed event-block:
            give player green concrete
            set event-block to light gray stained glass
        else:
            send "&cYou Don't Own This!" to player
            cancel event
 
You need to use variables.

Code:
on place:
    if event-block is green concrete:
        set {concrete::%event-location%} to player

on right click:
    if clicked block is green concrete:
        if {concrete::%event-location%} is player:
            give player green concrete
            set event-block to light gray stained glass
            delete {concrete::%event-location%}
        else:
            send "&cYou Don't Own This!" to player
            cancel event
 
It returns an error, since `if player placed event-block:` isn’t real syntax.

If I were you, I’d use SkBee and when placeing the block, i would set a Custom NBT tag, to the uuid of the player - as identifier.
 
You need to use variables.

Code:
on place:
    if event-block is green concrete:
        set {concrete::%event-location%} to player

on right click:
    if clicked block is green concrete:
        if {concrete::%event-location%} is player:
            give player green concrete
            set event-block to light gray stained glass
            delete {concrete::%event-location%}
        else:
            send "&cYou Don't Own This!" to player
            cancel event
it says i dont own it when i click it even tho i placed it
 
it says i dont own it when i click it even tho i placed it
I'm working at the moment so can't test. Try this, if it doesn't work, you'll need to try debugging it yourself.
Code:
on place:
    if event-block is green concrete:
        set {concrete::%event-location%} to player

on right click:
    if {concrete::%event-location%} is player:
        give player green concrete
        set event-block to light gray stained glass
        delete {concrete::%event-location%}
    else:
        send "&cYou Don't Own This!" to player
        cancel event
 
also anyone know about this???

1693302856499.png