Solved On place of block

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

BryHunter

Member
Jan 10, 2018
35
2
8
27
How can I make it so if a player places a block then only that player can break the block?
 
Oh haha, i replied to your other post.
Anyways this ones SUPER easy, but the problem here is, you will have to set a variable each time a player places a block, which in turn will LOAD your variable.csv FULL of a lot of useless variables
but here goes:
code_language.skript:
on block place of cobble:
    set {blockplace::%event-location%} to player

on block break of cobble:
    if {blockplace::%event-location%} is set:
        if {blockplace::%event-location%} is not player:
            cancel event
 
  • Like
Reactions: BryHunter
Oh haha, i replied to your other post.
Anyways this ones SUPER easy, but the problem here is, you will have to set a variable each time a player places a block, which in turn will LOAD your variable.csv FULL of a lot of useless variables
but here goes:
code_language.skript:
on block place of cobble:
    set {blockplace::%event-location%} to player

on block break of cobble:
    if {blockplace::%event-location%} is set:
        if {blockplace::%event-location%} is not player:
            cancel event




Okay I wanna use this but make it so when blown up with tnt it deletes variable
 
Okay I wanna use this but make it so when blown up with tnt it deletes variable
Okay so I can try write something, but honestly you won't need it.
Because lets say block A is broken by TNT.... if another player places a block there, it would wipe out the variable and save it with the new player. So at the end of the day, it would basically do the same thing.
 
well I have the server setup so tnt is way to raid bases and that the block in players hand has name which they buy and its that block that don't break
Okay so I can try write something, but honestly you won't need it.
Because lets say block A is broken by TNT.... if another player places a block there, it would wipe out the variable and save it with the new player. So at the end of the day, it would basically do the same thing.
 
well I have the server setup so tnt is way to raid bases and that the block in players hand has name which they buy and its that block that don't break
okay, so this expression will need SkQuery to work
code_language.skript:
on explosion:
    loop the exploded blocks:
        if {blockplace::%location of loop-block%} is set:
            delete {blockplace::%location of loop-block%}
 
  • Like
Reactions: BryHunter
okay, so this expression will need SkQuery to work
code_language.skript:
on explosion:
    loop the exploded blocks:
        if {blockplace::%location of loop-block%} is set:
            delete {blockplace::%location of loop-block%}
How would I make it so with a specific pickaxe it breaks the block

code_language.skript:
on block break of cobble or sandstone or stone:6 or stone brick or stone:5 or wooden planks:
    if {blockplace::%event-location%} is set:
        if {blockplace::%event-location%} is not player:
            if name of player's held item contains "&8[&c&lAdmin Pickaxe&8]":
                set {blockplace::%event-location%} to player
 
i just realized I did the original code with cobble only
anyways i wasn't sure if you wanted it JUST cobble or not, if its not, then this should work
code_language.skript:
on block place:
    set {blockplace::%event-location%} to player


on block break:
    if {blockplace::%event-location%} is set:
        if {blockplace::%event-location%} is not player:
            if event-block is cobble or sandstone or stone:6 or stone brick or stone:5 or any wooden plank:
                if name of player's tool does not contain "&8[&c&lAdmin Pickaxe&8]":
                    cancel event
            else:
                cancel event
 
  • Like
Reactions: BryHunter
Is there a way I could create an auto miner

code_language.skript:
on place of dispenser:
set {blockstotal::%player%} to 0
if {blockstotal::%player%} is less than or equal to 500:
send "&7Auto Miners » Auto Miner placed."
set {last-mined-block::%event-location%} to block in front of event-block
set {last-mined-block::%event-location%} to air
add 1 to {blockstotal::%player%}
wait 1 second
else:
break event-block
 
Is there a way I could create an auto miner

code_language.skript:
on place of dispenser:
set {blockstotal::%player%} to 0
if {blockstotal::%player%} is less than or equal to 500:
send "&7Auto Miners » Auto Miner placed."
set {last-mined-block::%event-location%} to block in front of event-block
set {last-mined-block::%event-location%} to air
add 1 to {blockstotal::%player%}
wait 1 second
else:
break event-block
Hey, Im not entirely sure what you are trying to accomplish with this code. If you want to give a little more detail for what you are looking to do that would be great. Also, please start a new thread for this as its a different topic. Thank you :emoji_slight_smile:
 
  • Like
Reactions: BryHunter
Status
Not open for further replies.