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

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

RunaYoutube

Member
Nov 10, 2019
34
1
8
28
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:
on place of coal block:
    if name of player's held item = "&8&lCoal Gen"
    set {gens::%location of event-block%} to uuid of player
    if {gens::%player's uuid%} < 15:
        add 1 to {gens::%player's uuid%}
        while event-block is coal block:
            wait 60 ticks
            drop 1 coal above location of event-block
    else:
        cancel event
    else:
        send "" to player
        send "&bYou have reached your Gen Cap! &7%{gens::%player's uuid%}%&b/&715" to player
        send "" to player
        cancel event
 
Code:
every 3 seconds in "world":
    loop all indices of {gens::coal::*}:
        if block at loop-value is coal block:
            drop 1 coal above loop-value
        else if block at loop-value is not coal block:
            delete {gens::coal::%loop-value%}

on place of coal block:
    if name of player's held item = "&8&lCoal Gen":
        if {gens-used::%player's uuid%} < 15:
            add 1 to {gens-used::%player's uuid%}
            set {gens::coal::%location of event-block%} to uuid of player
            stop
        else:
            send "" to player
            send "&bYou have reached your Gen Cap! &7%{gens::%player's uuid%}%&b/&715" to player
            send "" to player
            cancel event
    else:
        cancel event
 
Status
Not open for further replies.