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.

Random TP

Discussion in 'Skript' started by SirmittensI, Nov 19, 2021.

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

    SirmittensI Member

    Joined:
    Sep 17, 2021
    Messages:
    2
    Likes Received:
    0
    Hey, I am trying to make a /trp command which will teleport you anywhere within 10k blocks of spawn.
    Here is what I have

    Code (Text):
    1. command /tpr:
    2.     description: Teleports you to a random area in your world
    3.     permission: dh.tpr
    4.     permission message:&cYou are unable to use this command
    5.     trigger:
    6.         set {_x} to a random integer between -9000 and 9000
    7.         set {_y} to 30
    8.         set {_z} to a random integer between -9000 and 9000
    9.         set {_world} to "Survival"
    10.         send "Teleporting you to %{_location}%" to player
    11.         set {_location} to location at {_x}, {_y}, {_z} in world {_world}
    12.         teleport the player to {_location}
    13.         wait 5 ticks
    14.         make player run cmd "top" as op
    For the most part, everything works except for
    Code (Text):
    1. set {_location} to location at {_x}, {_y}, {_z} in world {_world}
    Wich returns <none>
     
  2. Phuple

    Phuple Member

    Joined:
    Jun 25, 2021
    Messages:
    18
    Likes Received:
    1
    You can use the inbuilt Location function
    Code (Text):
    1. teleport player to location({_x}, {_y}, {_z}, player's world)
     
Thread Status:
Not open for further replies.

Share This Page

Loading...