Random TP

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

SirmittensI

Member
Sep 17, 2021
2
0
1
27
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:
command /tpr:
    description: Teleports you to a random area in your world
    permission: dh.tpr
    permission message:&cYou are unable to use this command
    trigger:
        set {_x} to a random integer between -9000 and 9000
        set {_y} to 30
        set {_z} to a random integer between -9000 and 9000
        set {_world} to "Survival"
        send "Teleporting you to %{_location}%" to player
        set {_location} to location at {_x}, {_y}, {_z} in world {_world}
        teleport the player to {_location}
        wait 5 ticks
        make player run cmd "top" as op

For the most part, everything works except for
Code:
set {_location} to location at {_x}, {_y}, {_z} in world {_world}
Wich returns <none>
 
You can use the inbuilt Location function
Code:
teleport player to location({_x}, {_y}, {_z}, player's world)
 
Status
Not open for further replies.