I'm trying to create a script, that when /blacklist-on it will cancel the event of breaking certain blocks(for now just stone bricks) and when /blacklist-off this feature will be removed, until /blacklist-on is typed again. so basically a toggle blacklist, that cancels breaking of blacklisted blocks.I already have something going:
[doublepost=1570482013,1570481982][/doublepost]btw dont mind the language in the messages. im from denmark.
Code:
variables:
{blacklist.blocks} = "off"
command /blacklist-on:
aliases: /bl on
permission: blacklist.on
permission message: "&cDu har ikke adgang til Blacklist!"
trigger:
if {blacklist.blocks} is "off":
send player title "&c&lBlacklist" with subtitle "&7Er lige blevet slået til"
set {blacklist.on} to "on"
if {blacklist.on} is "on":
toggle:
on block break:
if event-block is stone bricks:
cancel event
else:
set {blacklist.on} to "on"
command /blacklist-off:
aliases: /bl off
permission: blacklist.off
permission message: "&cDu har ikke adgang til Blacklist!"
trigger:
if {blacklist.blocks} is "on":
send player title "&c&lBlacklist" with subtitle "&7Er lige blevet slået fra"
set {blacklist.bloks} to "off"
if {blacklist.blocks} is "on":
c
cancel event
else:
set {blacklist.blocks} to "on"
else:
set {blacklist.blocks} to "off"