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.

i need help with break thing

Discussion in 'Skript' started by D3adEy3, Jan 1, 2021.

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

    D3adEy3 Member

    Joined:
    Jan 1, 2021
    Messages:
    2
    Likes Received:
    0
    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
     
  2. Turb032

    Turb032 Active Member

    Joined:
    Jan 16, 2020
    Messages:
    109
    Likes Received:
    0
    try this:
    Code (Text):
    1. on break of cobblestone:
    2.     cancel event
    3.     add 1 cobblestone to player's inventory
    this should break the block and respawn in but still give you the block
     
  3. Jakkeren

    Supporter

    Joined:
    Mar 23, 2017
    Messages:
    63
    Likes Received:
    3
    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 (Text):
    1. on block break:
    2.     cancel event
    3.     set {_block} to "%event block%" parsed as item
    4.     give player 1 of {_block}
    5.  
    Otherwise I'd just use Turbo032's code.
     
  4. Turb032

    Turb032 Active Member

    Joined:
    Jan 16, 2020
    Messages:
    109
    Likes Received:
    0
    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
     
    • Funny Funny x 1
  5. Jakkeren

    Supporter

    Joined:
    Mar 23, 2017
    Messages:
    63
    Likes Received:
    3
    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:

     
  6. kittkarrkitt

    Supporter

    Joined:
    Jan 4, 2021
    Messages:
    33
    Likes Received:
    0
    Ohh, this is really interesting. Gonna use this aswell! : -)
     
    • Creative Creative x 1
  7. FireRoz

    FireRoz Active Member

    Joined:
    May 28, 2020
    Messages:
    135
    Likes Received:
    6
    Code (Text):
    1. on break of cobblestone:
    2.   cancel event
    3.   give event-block to player
    is that what u want
     
  8. TehCheetah

    TehCheetah Member

    Joined:
    Feb 7, 2021
    Messages:
    49
    Likes Received:
    1
    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.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...