Hello, I am trying to make a script that whitelists specific blocks to be breakable. Since the blocks are all in one list I want it to check it from there. There are optimizations on the way but for now I'm just trying to figure out how. Could anyone help?
Here's my script if that helps:
[doublepost=1651170736,1651165506][/doublepost]Oh and I forgot to add, my addons are:
skript-gui
Skellett
skRayFall
SkQuery
Ticker
Here's my script if that helps:
Code:
on skript load:
set {whitelist.blocks::*} to gray glazed terracotta, white glazed terracotta, yellow glazed terracotta, blue glazed terracotta, green glazed terracotta, light blue glazed terracotta, black glazed terracotta
on block break:
if event-block is in region "gens":
if event-block isn't an element out of {whitelist.blocks::*}:
if player doesn't have permission "builder.bypass":
cancel event
message "&c&lHey!&r &7Sorry, but you can't break that block here."
else:
cancel event
set event-block to air
player's gamemode is survival
if event-block is gray glazed terracotta:
drop 1 gray glazed terracotta named "&8Coal generator" at event-block's location
if event-block is white glazed terracotta:
drop 1 white glazed terracotta named "&fIron generator" at event-block's location
if event-block is yellow glazed terracotta:
drop 1 yellow glazed terracotta named "&6Gold Generator" at event-block's location
if event-block is blue glazed terracotta:
drop 1 blue glazed terracotta named "&9Lapis Lazuli Generator" at event-block's location
if event-block is green glazed terracotta:
drop 1 green glazed terracotta named "&aEmerald Generator" at event-block's location
if event-block is light blue glazed terracotta:
drop 1 light blue glazed terracotta named "&bDiamond Generator" at event-block's location
if event-block is black glazed terracotta:
drop 1 black glazed terracotta named "&8&lNetherite Generator" at event-block's location
[CODE]
skript-gui
Skellett
skRayFall
SkQuery
Ticker