i need help with break thing

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

D3adEy3

Member
Jan 1, 2021
2
0
1
25
So i need help with when i break a block, it will give you the block that got breaked but not break the block if you understand

on break of any cobblestone:
give @p 1 cobblestone

like that, but the "on break of any cobbelstone:" does not work
 
try this:
Code:
on break of cobblestone:
    cancel event
    add 1 cobblestone to player's inventory

this should break the block and respawn in but still give you the block
 
So i need help with when i break a block, it will give you the block that got breaked but not break the block if you understand

on break of any cobblestone:
give @p 1 cobblestone

like that, but the "on break of any cobbelstone:" does not work

You shouldn't use the @p tag while working with skripts. I'd only use that for console- and command block commands. I made an event for you that should work with all blocks.

Code:
on block break:
    cancel event
    set {_block} to "%event block%" parsed as item
    give player 1 of {_block}

Otherwise I'd just use Turbo032's code.
 
You shouldn't use the @p tag while working with skripts. I'd only use that for console- and command block commands. I made an event for you that should work with all blocks.

Code:
on block break:
    cancel event
    set {_block} to "%event block%" parsed as item
    give player 1 of {_block}

Otherwise I'd just use Turbo032's code.
My code it's way easier to understand if you are a starter, yours it's the exact same thing but with variables so it does not change anything
 
My code it's way easier to understand if you are a starter, yours it's the exact same thing but with variables so it does not change anything

If he's new, I'm sure that learning about variables would benefit him greatly in the long run. In case he'd want the skript to work with other blocks than just cobblestone my code would save him a lot of time, and if not, yours should be good, which is why I referenced it in my comment:

Otherwise I'd just use Turbo032's code.
 
Code:
on break of cobblestone:
  cancel event
  give event-block to player
is that what u want
 
If he's new, I'm sure that learning about variables would benefit him greatly in the long run. In case he'd want the skript to work with other blocks than just cobblestone my code would save him a lot of time, and if not, yours should be good, which is why I referenced it in my comment:

I agree with this. I see many people here try and work with code using no variables.
Learning to use them is a good thing, and sometimes, I prefer using codes with variables.
 
Status
Not open for further replies.