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!
You can always check out skUnity Downloads for downloads and any other information about Skript!
on rightclick:
if clicked block is acacia_slab:
message "that's a slab allright" to event-player
#run functions
But how I can prevent from happening this? I need that for multiple workbench's. Like if you placed the slab, then you open it with right click or F. But I don't want it to be openable by right clicking it from your inventory, only if its placed on ground.for rightclick is simple:
might wanna check that you're not holding the block though, to prevent it fro triggering when placing.Code:on rightclick: if clicked block is acacia_slab: message "that's a slab allright" to event-player #run functions
if you want to include upside down or double slabs you need to put those in as well.
But how I can prevent from happening this? I need that for multiple workbench's. Like if you placed the slab, then you open it with right click or F. But I don't want it to be openable by right clicking it from your inventory, only if its placed on ground.
on right click:
if event-block is acacia slab item or upside-down acacia slab item:
send "that's an acacia slab alright" to player
#any code here
But he said that I have to prevent people from holding the block. I need it so you can use it only if you place the slab on ground.It's really hard to understand you, "Tymen van Essen's" method should work perfectly. You want people to right click on an acacia slab to run a command, right?
Code:on right click: if event-block is acacia slab item or upside-down acacia slab item: send "that's an acacia slab alright" to player #any code here
[Skript] Encountered 1 error while reloading wb1.sk!
i mean that when you are placing a slab on top of, or next to another slab you rightclick that first slab. meaning you are both right clicking and placing that slab at that time.But he said that I have to prevent people from holding the block. I need it so you can use it only if you place the slab on ground.
on right click:
if event-block is acacia slab item or top acacia slab item:
send "that's an acacia slab alright" to player
#any code here
I am still having same errori mean that when you are placing a slab on top of, or next to another slab you rightclick that first slab. meaning you are both right clicking and placing that slab at that time.
the code i gave does not cancel the placing
it is like when placing a chest on top of a chest, you have to hold shift to not open the inventory, but wont place the block when not holding shift. my code would both place the block and run the command and ignores shift.
on your other error, you can try if this works:
Code:on right click: if event-block is acacia slab item or top acacia slab item: send "that's an acacia slab alright" to player #any code here
on right click:
if event-block is acacia slab or top acacia slab:
send "that's an acacia slab alright" to player
#any code here
It worked. Thank you so much!my bad, yeah you don't want to put 'item' in that line at all.
this one i tested though: and the first one i originally gave you works too for the normal slab.
Code:on right click: if event-block is acacia slab or top acacia slab: send "that's an acacia slab alright" to player #any code here