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 out 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.

not allowing block placement if block doesn't have a certain name

Discussion in 'Skript' started by RunaYoutube, Dec 6, 2020.

Thread Status:
Not open for further replies.
  1. RunaYoutube

    RunaYoutube Member

    Joined:
    Nov 10, 2019
    Messages:
    34
    Likes Received:
    1
    im trying to make a skript where if you don't have a block with a certain name it wont let you place it but I cant figure out how to do it
    Code (Text):
    1. on place of coal block:
    2.     if name of player's held item = "&8&lCoal Gen"
    3.     set {gens::%location of event-block%} to uuid of player
    4.     if {gens::%player's uuid%} < 15:
    5.         add 1 to {gens::%player's uuid%}
    6.         while event-block is coal block:
    7.             wait 60 ticks
    8.             drop 1 coal above location of event-block
    9.     else:
    10.         cancel event
    11.     else:
    12.         send "" to player
    13.         send "&bYou have reached your Gen Cap! &7%{gens::%player's uuid%}%&b/&715" to player
    14.         send "" to player
    15.         cancel event
     
  2. DeadlySkyLord

    DeadlySkyLord Member

    Joined:
    May 23, 2020
    Messages:
    11
    Likes Received:
    0
    Code (Text):
    1. every 3 seconds in "world":
    2.     loop all indices of {gens::coal::*}:
    3.         if block at loop-value is coal block:
    4.             drop 1 coal above loop-value
    5.         else if block at loop-value is not coal block:
    6.             delete {gens::coal::%loop-value%}
    7.  
    8. on place of coal block:
    9.     if name of player's held item = "&8&lCoal Gen":
    10.         if {gens-used::%player's uuid%} < 15:
    11.             add 1 to {gens-used::%player's uuid%}
    12.             set {gens::coal::%location of event-block%} to uuid of player
    13.             stop
    14.         else:
    15.             send "" to player
    16.             send "&bYou have reached your Gen Cap! &7%{gens::%player's uuid%}%&b/&715" to player
    17.             send "" to player
    18.             cancel event
    19.     else:
    20.         cancel event
     
Thread Status:
Not open for further replies.

Share This Page

Loading...