/top command

  • 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.
You need TuSKe for this script to work (because of the "is solid" condition).
code_language.skript:
command /top:
  permission: skript.top
  executeable by: player
  description: Teleports the player to the highest block at their XZ location.
  trigger:
    set {_loc} to location at player
    set y-coord of {_loc} to 256
    loop 256 times:
      if y-coord of {_loc} is y-coord of location at player:
        message "&6You are already at the top!"
        stop
      if block at {_loc} is a solid block:
        teleport player to block above {_loc}
        message "&6To the top!"
        stop
      else:
        remove 1 from y-coord of {_loc}
 
hello how can i do /top command on skript thanks for help
More information would be good..
[doublepost=1492814131,1492814098][/doublepost]
You need TuSKe for this script to work (because of the "is solid" condition).
code_language.skript:
command /top:
  permission: skript.top
  executeable by: player
  description: Teleports the player to the highest block at their XZ location.
  trigger:
    set {_loc} to location at player
    set y-coord of {_loc} to 256
    loop 256 times:
      if y-coord of {_loc} is y-coord of location at player:
        message "&6You are already at the top!"
        stop
      if block at {_loc} is a solid block:
        teleport player to block above {_loc}
        message "&6To the top!"
        stop
      else:
        remove 1 from y-coord of {_loc}
You can do it without TuSKe
 
Status
Not open for further replies.