How to set variable to 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.

BrownMee

Active Member
Apr 16, 2018
126
6
18
23
Code:
on break of stone:
    chance of 100%:
        loop all blocks in radius 3 around player:
            add 1 to {_x}
        set {_x} to random integer between 1 and {_x}
        loop all blocks in radius 3 around player:
            add 1 to {_y}
            {_x} is {_y}
            set {_belphite} to location of loop-block
            exit loop
        set block at {_belphite} to lapis ore
        add 1 to {_belphite}'s y-coordinate
        create hologram "&a&l&nBelphite Ores" at {_belphite} for 300 seconds
        wait 5 minutes
        set {_belphite} to air

Code:
on click on lapis ore:
    if {_belphite}'s location is equal to event-block's location:
        cancel event
        send "m"


I have lost of ideas. Anyone know how to do it? This is for mining on caves
While mining stones there's 0.01% chance that it will spawn unique ores and i wanna set the unique ores to a variable so when the players mines it it triggers something because its a variable blocks
 
add the location to a dictionary

set {listofblocks::%location of loop-block%} to "lapis"

on click on lapis ore:
if {listofblocks::%location of event-block%} is "lapis"



Your errors:
You use local variables. Underscore marks a variable as local. Local means that the variable gets deleted after the current event/command/and more


On break:
set {_t} to "message"

on click:
send "%{_t}%"
#sends '<none>'

on click:
send "%{t}%"
#sends '<none>'

On break:
set {t} to "message"

on click:
send "%{t}%"
#sends 'message'
 
Status
Not open for further replies.