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.

How to set a block to a block name stored in a variable

Discussion in 'Skript' started by cottondell, Aug 18, 2019.

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

    cottondell Member

    Joined:
    Aug 16, 2019
    Messages:
    14
    Likes Received:
    0
    Basically im making regenerating blocks which when you break, it replaces it with what it was so i need {rb.block.%event-block%} to set the block to what it was before it was broken. so i need it so {rb.block.%event-block%} is different even if the same block was placed down but in a different posittion because i also have {rb.player.%event-block%} so i can see if the player breaking the block is the owner of the regenerating block and the players can have multiple RegeneratingBlocks placed down.
    I'm sorry for confusing you.
    --- Double Post Merged, Aug 19, 2019, Original Post Date: Aug 19, 2019 ---
    If theres a way too easily set a block to what it was before it was broken then that would be fine
     
  2. H3A

    H3A Member

    Joined:
    Aug 19, 2019
    Messages:
    30
    Likes Received:
    1
    Code (Text):
    1. set {block} to "coal ore"
    2.  
    3. set event-block to {block}
     
  3. cottondell

    cottondell Member

    Joined:
    Aug 16, 2019
    Messages:
    14
    Likes Received:
    0
    H3A the block wont always be coal ore, i could place down iron_ore then it wouldnt work with that and ive tried that alooooot
     
  4. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    314
    Likes Received:
    21
    Issue there is you are setting {block} to a string type...

    To do what you want:
    Code (Skript):
    1. on break:
    2.     set {BLOCK::BROKEN::%player%} to event-block
    3.     add event-block to {BLOCKS::BROKEN::%player%::*}
     
  5. H3A

    H3A Member

    Joined:
    Aug 19, 2019
    Messages:
    30
    Likes Received:
    1
    Create a list then, If it's randomized.
    Else just make a function.
     
  6. cottondell

    cottondell Member

    Joined:
    Aug 16, 2019
    Messages:
    14
    Likes Received:
    0
    no, i dont mean that H3A, I think ima have to go a different route and redo my script :/
     
Thread Status:
Not open for further replies.

Share This Page

Loading...