Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Random-TP skript
- #This skript inplements a randomtp command with in-game configurable values (like teleport range)
- #if you found a bug or have questions feel free to add me on skype: Hiroyugane
- #This skript is by Hiroyugane_DE. You may can use it for your server or private. You may cannot re-upload it or make money from it.
- #(configurable costs and delay are work in progress)
- #
- Skript start:
- if {random.min} is not set:
- set {random.min} to -5000
- if {random.max} is not set:
- set {random.max} to 5000
- if {random.height} is not set:
- set {random.height} to 100
- else:
- stop
- command /randomtp [<text>] [<player=%player%>]:
- trigger:
- if arg-1 is "use":
- if player has permission "randomtp.use.self":
- if player has 4 diamonds:
- set {_waited} to difference between {randomtp.%player%.lastused} and now
- if {_waited} is less than 5 minutes:
- message "&c&nSorry&r,&7 but you have to wait &d%difference between 5 minutes and {_waited}% &7before you can use this command again!"
- stop
- else:
- remove 8 diamonds from player
- set {randomtp.%player%.lastused} to now
- send "&8>&c> &e&nTeleportation is being prepared"
- set {_random.cord.x} to a random integer between {random.min} and {random.max}
- set {_random.cord.y} to {random.height}
- set {_random.cord.z} to a random integer between {random.min} and {random.max}
- set {_currentlocation} to location of arg-player
- set {_relative.x} to rounded down the x coord of {_currentlocation}
- subtract {_random.cord.x} from {_relative.x}
- set {_relative.y} to rounded down the y coord of {_currentlocation}
- subtract {_random.cord.y} from {_relative.y}
- set {_relative.z} to rounded down the z coord of {_currentlocation}
- subtract {_random.cord.z} from {_relative.z}
- set {_destinationx} to the block {_relative.x} west of the block at {_currentlocation}
- set {_destinationy} to the block {_relative.y} below the block at {_destinationx}
- set {_destination} to the block {_relative.z} north of the block at {_destinationy}
- wait 50 tick
- send "&8>&c> &e&nTeleporting you to &4&n%{_random.cord.x}%, %{_random.cord.y}%, %{_random.cord.z}%"
- wait 25 tick
- send "&2&l3..."
- wait 25 tick
- send "&6&l2..."
- wait 25 tick
- send "&4&l1..."
- wait 25 tick
- teleport the player to {_destination}
- wait 5 ticks
- send "&8>&c> &4&nSuccessfully&r &e&nTeleported!"
- stop
- else:
- send "&c&nSorry&r, &7but you need &b&n8 diamonds&7 to use this function."
- stop
- if arg-2 is not player:
- if player has permission "randomtp.use.others":
- send "&8>&c> &e&nAn Admin forced a random teleportation" to arg 2
- send "&8>&c> &e&nteleporting in 10 seconds" to arg 2
- wait 100 tick
- send "&8>&c> &e&nTeleportation is being prepared"
- set {_random.cord.x} to a random integer between {random.min} and {random.max}
- set {_random.cord.y} to {random.height}
- set {_random.cord.z} to a random integer between {random.min} and {random.max}
- set {_currentlocation} to location of arg-player
- set {_relative.x} to rounded down the x coord of {_currentlocation}
- subtract {_random.cord.x} from {_relative.x}
- set {_relative.y} to rounded down the y coord of {_currentlocation}
- subtract {_random.cord.y} from {_relative.y}
- set {_relative.z} to rounded down the z coord of {_currentlocation}
- subtract {_random.cord.z} from {_relative.z}
- set {_destinationx} to the block {_relative.x} west of the block at {_currentlocation}
- set {_destinationy} to the block {_relative.y} below the block at {_destinationx}
- set {_destination} to the block {_relative.z} north of the block at {_destinationy}
- wait 50 tick
- send "&8>&c> &e&nTeleporting you to &4&n%{_random.cord.x}%, %{_random.cord.y}%, %{_random.cord.z}%"
- wait 25 tick
- send "&2&l3..."
- wait 25 tick
- send "&6&l2..."
- wait 25 tick
- send "&4&l1..."
- wait 25 tick
- teleport the player to {_destination}
- wait 5 ticks
- send "&8>&c> &4&nSuccessfully&r &e&nTeleported!"
- stop
- else:
- send "&c&nSorry&r, &7but you're not allowed to teleport others."
- stop
- else:
- send "&c&nSorry&r, &7but you're not allowed to do that."
- stop
- if arg-1 is "help":
- if player has permission "randomtp.help":
- send " &e&lRandom&6&lTp"
- send "&7/&9randomtp &ause &7- &eTo take a randomtp (this costs 8 diamonds)"
- send "&7/&3randomtp &cconfig &7- &eFor editing variables"
- stop
- else:
- send "&c&nSorry&r, &7but you're not allowed to do that."
- stop
- if arg-1 is "config":
- if player has permission "randomtp.admin":
- send " &e&lRandomTp &cAdmin"
- send "&7/&2randommin &9[value] &7- &ddefault is -5000"
- send "&7/&4randommax &9[value] &7- &ddefault is 5000"
- send "&7/&brandomheight &9[value] &7- &ddefault is 100"
- send "&7/&6randomcooldown &9[value] &7- &ddefault is 5"
- send "&7/&3randomcost &9[value] &7- &ddefault is 4"
- stop
- else:
- send "&c&nSorry&r, &7but you're not allowed to do that."
- stop
- else:
- send "&8>&c>If you don't know what to do, use &7/&erandomtp &6help"
- stop
- command /randommin [<integer>]:
- description: Sets the minimum value for x and z coordinates
- permission: randomtp.admin
- permission message: &4&nPlease go back to the user area.
- trigger:
- if arg-1 is set:
- set {random.min} to arg-1
- send "&8>&c> &a&nminvalue set to %arg-1%"
- stop
- else:
- send "&3The current value is %{random.min}%"
- command /randommax [<integer>]:
- description: Sets the maximum value for x and z coordinates
- permission: randomtp.admin
- permission message: &4&nPlease go back to the user area.
- trigger:
- if arg-1 is set:
- set {random.max} to arg-1
- send "&8>&c> &a&nmaxvalue set to %arg-1%"
- stop
- else:
- send "&3The current value is %{random.max}%"
- command /randomheight [<integer>]:
- description: Sets the y coordinate (it has to be between 0 and 255)
- permission: Randomtp.admin
- permission message: &4&nPlease go back to the user area.
- trigger:
- if arg-1 is set:
- if arg-1 is between 0 and 255:
- set {random.height} to arg-1
- send "&8>&c> &a&nheightvalue set to %arg 1%"
- stop
- else:
- send "&8>&c> &c&nThe value isn't valid"
- stop
- else:
- send "&3The current value is %{random.height}%"
- #command /randomcooldown [<integer>]:
- # description: Sets the cooldown for this command (in minutes)
- # permission: Randomtp.admin
- # permission message: &4&nPlease go back to the user area.
- # trigger:
- # set {random.cooldown} to "%arg 1% minutes"
- # send "&8>&c> &a&ncooldownvalue set to %arg 1% minutes"
- #
- # >>>If you know how to let this work feel free to send me the idea<<<
- #
- #command /randomcost [<integer>]:
- # description: Sets the cost for this command
- # permission: Randomtp.admin
- # permission message: &4&nPlease go back to the user area.
- # trigger:
- # set {random.cost} to arg-1
- # send "&8>&c> &a&ncost set to %arg 1% diamonds"
Add Comment
Please, Sign In to add comment