#I wanna check if a glass is next to event-block

1 messages · Page 1 of 1 (latest)

flint relic
#

do you get an error or something?

tender sierra
#

no

#

It just dosent send the message when I place it on Glass

tender sierra
#
    loop blocks in radius 5 around the player:
        if loop-block is workbench:
            if block 1 below event-block is Glass:
                send "&cThis terretory is already contested" to player
    cancel event```
#

It works like this

#

But not like this:

    set {glasses::*} to "Glass"

on place of a workbench:
    loop blocks in radius 5 around the player:
        if loop-block is workbench:
            if block 1 below event-block is {glasses::*}:
                send "&cThis terretory is already contested" to player
    cancel event```
uncut sparrow
#

if block under event-block is glass should do

tender sierra
#

thats what Im trying to avoid

tiny geyser
#

why?

tender sierra
#

now im just checking for them separetly:

#
                send "&cThis terretory is already contested" to player
                cancel event
            if block 1 below event-block is White Stained Glass:
                send "&cThis terretory is already contested" to player
                cancel event```
#

I only needed something to shorten the code

tiny geyser
tender sierra
#

👍

tiny geyser
#

which will account for all types of glass, or you could do:

tender sierra
#

oh damn thats nice

tiny geyser
#

or you could do set {glass::*} to glass and white stained glass inside of an on load

then later in the script do if {glass::*} contains type of event-block

tender sierra
#

I already tried that and it didnt work loaded without errors

#

Also this dosent send the message when placed on glass

    loop blocks in radius 2 around the event-block:
        if loop-block is workbench:
            if block 1 below event-block contains "Glass":
                send "&cThis terretory is already contested" to player
                cancel event
                        else:
                                cancel event```
tiny geyser
#

why are you looping

tender sierra
#

Im learning skript and I learned there are things you can only do inside a loop

#

this aint one of them?

tender sierra
#

I didnt really use this word untill now but, bet

tender sierra