1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Blacklisted Blocks

Discussion in 'Skript' started by Lemonboy911, Oct 7, 2019.

  1. Lemonboy911

    Lemonboy911 Member

    Joined:
    Oct 7, 2019
    Messages:
    10
    Likes Received:
    0
    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 (Text):
    1. variables:
    2.     {blacklist.blocks} = "off"
    3.  
    4. command /blacklist-on:
    5.     aliases: /bl on
    6.     permission: blacklist.on
    7.     permission message: "&cDu har ikke adgang til Blacklist!"
    8.     trigger:
    9.         if {blacklist.blocks} is "off":
    10.             send player title "&c&lBlacklist" with subtitle "&7Er lige blevet slået til"
    11.             set {blacklist.on} to "on"
    12.             if {blacklist.on} is "on":
    13.                 toggle:
    14.                     on block break:
    15.                         if event-block is stone bricks:
    16.                             cancel event
    17.             else:
    18.                 set {blacklist.on} to "on"
    19.  
    20.  
    21.  
    22. command /blacklist-off:
    23.     aliases: /bl off
    24.     permission: blacklist.off
    25.     permission message: "&cDu har ikke adgang til Blacklist!"
    26.     trigger:
    27.         if {blacklist.blocks} is "on":
    28.             send player title "&c&lBlacklist" with subtitle "&7Er lige blevet slået fra"
    29.             set {blacklist.bloks} to "off"
    30.             if {blacklist.blocks} is "on":
    31.                 c
    32.                     cancel event
    33.             else:
    34.                 set {blacklist.blocks} to "on"
    35.         else:
    36.             set {blacklist.blocks} to "off"
    --- Double Post Merged, Oct 7, 2019, Original Post Date: Oct 7, 2019 ---
    btw dont mind the language in the messages. im from denmark. :emoji_slight_smile:
     
  2. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    406
    Likes Received:
    14
    I think you didn't realize, but, there are variables with different names.
    [​IMG]
    Something else. I recommend you that you use the events apart of triggers. A example:
    Code (Skript):
    1.  
    2. If you set the variable {blacklist.blocks} to "on", make more code down instead of putting it on the same line.
    3.  
    4. command /blacklist-on:
    5.     trigger:
    6.         set {blacklist.blocks} to "on"
    7.  
    8. on block break:
    9.     if {blacklist.blocks} is "on":
    10.         cancel event  
    11.  
     
  3. Lemonboy911

    Lemonboy911 Member

    Joined:
    Oct 7, 2019
    Messages:
    10
    Likes Received:
    0
    Thx for the answer didnt really think about it this way. :emoji_slight_smile:
     
Loading...