#I wanna check if a glass is next to event-block
1 messages · Page 1 of 1 (latest)
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```
if block under event-block is glass should do
thats what Im trying to avoid
why?
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
this is testing for if %block% is %list%, which will always be false since a single block is never multiple objects (a list)
👍
if "%event-block%" contains "glass"
which will account for all types of glass, or you could do:
oh damn thats nice
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
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```
why are you looping
Im learning skript and I learned there are things you can only do inside a loop
this aint one of them?
that's not entirely true
I didnt really use this word untill now but, bet
changed it works thanks