Solved Skript packet blocks

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

xultraalphax

New Member
Jul 3, 2020
6
0
0
24
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:
command /grass [<text>]:
  aliases: /fű, /fu, /weed
  trigger:
    if arg-1 is not set:
      if {grass.%player%} is false:
        set {grass.%player%} to true
        send "&6MN &8»&7 Sikeresen &ebekapcsoltad&7 a növények eltűntetését!"
      else:
        set {grass.%player%} to false
        send "&6MN &8»&7 Sikeresen &ekikapcsoltad&7 növények eltűntetését!"
    else if arg-1 is set:
      if arg-1 is "reload" or "rl":
          execute player command "sk reload MoszkvaGrass"
          send "&6MN &8»&7 Plugin sikeresen újratöltve!"
    else:
      send "&6MN &8»&7 Helyes használat: &c/grass"


on any movement:
  if {grass.%player%} is true:
    wait 10 tick
    loop all blocks in radius 5 around the player:
      if loop-block is poppy:
        make player see loop-block as air
    wait 1 tick
 

Attachments

  • MoszkvaGrass.sk
    852 bytes · Views: 246
Last edited:
Code:
make player see loop-block as loop-block
This should change it to the original block
 
Code:
make player see loop-block as loop-block
This should change it to the original block
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
[doublepost=1593816598,1593815216][/doublepost]Does anyone have a solution?
 
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).
 
I have written this code, and I get an error
Code:
command /grass [<text>]:
  aliases: /fű, /fu, /weed
  trigger:
    if arg-1 is not set:
      if {grass.%player%} is false:
        set {grass.%player%} to true
        send "&6MN &8»&7 Sikeresen &ebekapcsoltad&7 a növények eltűntetését!"
      else:
        set {grass.%player%} to false
        send "&6MN &8»&7 Sikeresen &ekikapcsoltad&7 növények eltűntetését!"
    else if arg-1 is set:
      if arg-1 is "reload" or "rl":
        execute player command "sk reload MoszkvaGrass"
        send "&6MN &8»&7 Plugin sikeresen újratöltve!"
    else:
      send "&6MN &8»&7 Helyes használat: &c/grass"

on any movement:
  if {grass.%player%} is true:
    wait 10 tick
    loop all blocks in radius 4 around the player:
      if loop-block is poppy:
        make player see loop-block as air
        add location of loop-block to {grass.%player%.::*}
    wait 1 tick

on any movement:
  if {grass.%player%.::*} is set:
    wait 10 tick
    loop block at {grass.%player%.::*}:
      loop all entities in radius 4 around the loop-block:
        if loop-entity is not the player:
          make player see loop-block-1 as loop-block-1
          remove loop-block-1 from {grass.%player%.::*}
          stop the loop
    wait 1 tick
error.png

[doublepost=1593891974,1593821018][/doublepost]Can anyone help me?
 
Status
Not open for further replies.