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.

Solved Skript packet blocks

Discussion in 'Skript' started by xultraalphax, Jul 3, 2020.

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

    xultraalphax New Member

    Joined:
    Jul 3, 2020
    Messages:
    6
    Likes Received:
    0
    Hello! So I wanted to make a skript where players can toggle seeing grass and flowers by /grass command. I wanted to use "make player see block as block" but I have ran into a problem. I wasn't able to make the player see the flowers for a temporary time so it will remain as air. Could you help me please?

    Code (Text):
    1. command /grass [<text>]:
    2.   aliases: /fű, /fu, /weed
    3.   trigger:
    4.     if arg-1 is not set:
    5.       if {grass.%player%} is false:
    6.         set {grass.%player%} to true
    7.         send "&6MN &8»&7 Sikeresen &ebekapcsoltad&7 a növények eltűntetését!"
    8.       else:
    9.         set {grass.%player%} to false
    10.         send "&6MN &8»&7 Sikeresen &ekikapcsoltad&7 növények eltűntetését!"
    11.     else if arg-1 is set:
    12.       if arg-1 is "reload" or "rl":
    13.           execute player command "sk reload MoszkvaGrass"
    14.           send "&6MN &8»&7 Plugin sikeresen újratöltve!"
    15.     else:
    16.       send "&6MN &8»&7 Helyes használat: &c/grass"
    17.  
    18.  
    19. on any movement:
    20.   if {grass.%player%} is true:
    21.     wait 10 tick
    22.     loop all blocks in radius 5 around the player:
    23.       if loop-block is poppy:
    24.         make player see loop-block as air
    25.     wait 1 tick
    26.  
     

    Attached Files:

    #1 xultraalphax, Jul 3, 2020
    Last edited: Jul 3, 2020
  2. Juffix

    Juffix Member

    Joined:
    Apr 7, 2019
    Messages:
    19
    Likes Received:
    4
    Code (Text):
    1. make player see loop-block as loop-block
    This should change it to the original block
     
  3. xultraalphax

    xultraalphax New Member

    Joined:
    Jul 3, 2020
    Messages:
    6
    Likes Received:
    0
    I know, but the only problem is it is going to be flashing between air and the original block. I want to change it back after the player is further than 5 blocks
    --- Double Post Merged, Jul 3, 2020, Original Post Date: Jul 3, 2020 ---
    Does anyone have a solution?
     
  4. Juffix

    Juffix Member

    Joined:
    Apr 7, 2019
    Messages:
    19
    Likes Received:
    4
    I guess you can add the blocks into a list loop it and check the distance between the block and the player (Not efficient but your skript isn't efficient either).
     
  5. xultraalphax

    xultraalphax New Member

    Joined:
    Jul 3, 2020
    Messages:
    6
    Likes Received:
    0
    I have written this code, and I get an error
    Code (Text):
    1.  
    2. command /grass [<text>]:
    3.   aliases: /fű, /fu, /weed
    4.   trigger:
    5.     if arg-1 is not set:
    6.       if {grass.%player%} is false:
    7.         set {grass.%player%} to true
    8.         send "&6MN &8»&7 Sikeresen &ebekapcsoltad&7 a növények eltűntetését!"
    9.       else:
    10.         set {grass.%player%} to false
    11.         send "&6MN &8»&7 Sikeresen &ekikapcsoltad&7 növények eltűntetését!"
    12.     else if arg-1 is set:
    13.       if arg-1 is "reload" or "rl":
    14.         execute player command "sk reload MoszkvaGrass"
    15.         send "&6MN &8»&7 Plugin sikeresen újratöltve!"
    16.     else:
    17.       send "&6MN &8»&7 Helyes használat: &c/grass"
    18.  
    19. on any movement:
    20.   if {grass.%player%} is true:
    21.     wait 10 tick
    22.     loop all blocks in radius 4 around the player:
    23.       if loop-block is poppy:
    24.         make player see loop-block as air
    25.         add location of loop-block to {grass.%player%.::*}
    26.     wait 1 tick
    27.  
    28. on any movement:
    29.   if {grass.%player%.::*} is set:
    30.     wait 10 tick
    31.     loop block at {grass.%player%.::*}:
    32.       loop all entities in radius 4 around the loop-block:
    33.         if loop-entity is not the player:
    34.           make player see loop-block-1 as loop-block-1
    35.           remove loop-block-1 from {grass.%player%.::*}
    36.           stop the loop
    37.     wait 1 tick
    38.  
    [​IMG]
    --- Double Post Merged, Jul 4, 2020, Original Post Date: Jul 4, 2020 ---
    Can anyone help me?
     
Thread Status:
Not open for further replies.

Share This Page

Loading...