Blacklisted Blocks

  • Welcome to skUnity!

    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 comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Lemonboy911

Member
Oct 7, 2019
10
0
0
18
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:

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"
[doublepost=1570482013,1570481982][/doublepost]btw dont mind the language in the messages. im from denmark. :emoji_slight_smile:
 
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:

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"
[doublepost=1570482013,1570481982][/doublepost]btw dont mind the language in the messages. im from denmark. :emoji_slight_smile:
I think you didn't realize, but, there are variables with different names.
0bf2ff8b53b3b582ba737db04f6c5a36.png

Something else. I recommend you that you use the events apart of triggers. A example:
code_language.skript:
If you set the variable {blacklist.blocks} to "on", make more code down instead of putting it on the same line.

command /blacklist-on:
    trigger:
        set {blacklist.blocks} to "on"

on block break:
    if {blacklist.blocks} is "on":
        cancel event
 
I think you didn't realize, but, there are variables with different names.
0bf2ff8b53b3b582ba737db04f6c5a36.png

Something else. I recommend you that you use the events apart of triggers. A example:
code_language.skript:
If you set the variable {blacklist.blocks} to "on", make more code down instead of putting it on the same line.

command /blacklist-on:
    trigger:
        set {blacklist.blocks} to "on"

on block break:
    if {blacklist.blocks} is "on":
        cancel event
Thx for the answer didnt really think about it this way. :emoji_slight_smile:
 
Status
Not open for further replies.