Guest User

Untitled

a guest
Nov 5th, 2013
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. Options:
  2. xMin: -9000 #Minimum x coordinate to teleport to
  3. xMax: 9000 #Maximum x coordinate to teleport to
  4. zMin: -9000 #Minimum z coordinate to teleport to
  5. zMax: 9000 #Maximum z coordinate to teleport to
  6. world: world #The name of the world
  7. loop: 20 #How many times to loop the script. 20 is usually WAY more than enough
  8. pause: 0.5 #How long to wait between each loop
  9. color: aqua #The color of the message sent to the player
  10.  
  11. Command /randomtp:
  12. description: Teleports player to random location not in water
  13. usage: /randomtp
  14. permission: randomtp.use
  15. aliases: /rtp
  16. trigger:
  17. Loop {@loop} times:
  18. Set {_targetx} to a random integer between {@xMin} and {@xMax} #Location within world boundaries
  19. Set {_targetz} to a random integer between {@zMin} and {@zMax} #Location within world boundaries
  20. Execute console command "/getlocation %{_targetx}% 63 %{_targetz}% {@world}" #Convert location to useable format
  21. Set {_destination} to {ktools.location} #Convert global location to local variable
  22. Set {_light} to light level at {_destination} #Get light level at random location
  23. If the block 1 below the block at {_destination} is not water: #Make sure we don't teleport into water
  24. Send "<{@color}>Teleporting you to %{_targetx}%, %{_targetz}%" to player #Let the player know where they're going
  25. Execute console command "/tp %player% %{_targetx}% 256 %{_targetz}%" #Teleport player to highest y-coordinate. Will put them at highest block at x and z
  26. Stop loop
  27. If {_light} is less than 4: #If the water is under a block or underground
  28. Send "<{@color}>Teleporting you to %{_targetx}%, %{_targetz}%" to player #Let the player know where they're going
  29. Execute console command "/tp %player% %{_targetx}% 256 %{_targetz}%" #Teleport player to highest y-coordinate. Will put them at highest block at x and z
  30. Stop loop
  31. Wait {@pause} second
Advertisement
Add Comment
Please, Sign In to add comment