Advertisement
CMDProGamer

/spawn and stuff

Jul 7th, 2019
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.71 KB | None | 0 0
  1. on join:
  2. if player is in world "world":
  3. teleport player to {spawn.world}
  4. stop
  5. stop
  6. command /setspawn:
  7. permission: sk.setspawn
  8. description: Set the spawnpoint location for a world.
  9. trigger:
  10. execute console command "execute at %player% run setworldspawn"
  11. set {spawn.%world%} to location of player
  12. wait 1 tick
  13. message "&6%world%'s spawnpoint set! &8(%{spawn.%world%}%)" to player
  14. stop
  15. command /spawn:
  16. permission: sk.spawn
  17. description: Teleports you to the spawnpoint of the world.
  18. trigger:
  19. set {back.%player%} to location of player
  20. teleport player to {spawn.%world%}
  21. message "&3Teleporting to the spawn of world: &9%player's world%" to player
  22. stop
  23. command /back:
  24. permission: sk.back
  25. description: Return to a previous area.
  26. trigger:
  27. if {back.%player%} is set:
  28. set {back1.%player%} to location of player
  29. wait 1 tick
  30. teleport player to {back.%player%}
  31. message "&6Returning to previous position. &c(%{back.%player%}%)"
  32. wait 1 tick
  33. set {back.%player%} to {back1.%player%}
  34. stop
  35. else:
  36. message "&cCannot return to a previous location. Sorry!"
  37. stop
  38. command /rtp:
  39. permission: sk.rtp
  40. description: Teleport to a random location.
  41. aliases: /wild, /randomteleport, /randomtp
  42. trigger:
  43. set {back.%player%} to location of player
  44. execute console command "spreadplayers -311 -17 1000 30000 false %player%"
  45. message "&6Teleporting to a random location!" to player
  46. stop
  47. command /sethome <text> [<text>]:
  48. permission: sk.home
  49. executable by: players
  50. description: Set a home.
  51. trigger:
  52. if arg 2 is set:
  53. message "&4Please use one word for the name!"
  54. stop
  55. else:
  56. player is op:
  57. if {%player%.%arg 1%.location} is set:
  58. message "&cThat home already exists!"
  59. stop
  60. else:
  61. add arg 1 to {homes.%world%.%player%::*}
  62. set {%player%.%arg 1%.location} to location of player
  63. wait 1 tick
  64. message "&6Set home &c%arg 1% &6 at location: &c%{%player%.%arg 1%.location}%"
  65. stop
  66. stop
  67. player has permission "sk.sethome.infinite":
  68. if {%player%.%arg 1%.location} is set:
  69. message "&cThat home already exists!"
  70. stop
  71. else:
  72. add arg 1 to {homes.%world%.%player%::*}
  73. set {%player%.%arg 1%.location} to location of player
  74. wait 1 tick
  75. message "&6Set home &c%arg 1% &6 at location: &c%{%player%.%arg 1%.location}%"
  76. stop
  77. stop
  78. size of {homes.%world%.%player%::*} is less than 3:
  79. if {%player%.%arg 1%.location} is set:
  80. message "&cThat home already exists!"
  81. else:
  82. add arg 1 to {homes.%world%.%player%::*}
  83. set {%player%.%arg 1%.location} to location of player
  84. wait 1 tick
  85. message "&6Set home &c%arg 1% &6 at location: &c%{%player%.%arg 1%.location}%"
  86. stop
  87. size of {homes.%world%.%player%::*} is between 3 and 4:
  88. player has permission "sk.sethome.5":
  89. if {%player%.%arg 1%.location} is set:
  90. message "&cThat home already exists!"
  91. else:
  92. add arg 1 to {homes.%world%.%player%::*}
  93. set {%player%.%arg 1%.location} to location of player
  94. wait 1 tick
  95. message "&6Set home &c%arg 1% &6 at location: &c%{%player%.%arg 1%.location}%"
  96. stop
  97. player does not have permission "sk.sethome.5":
  98. message "&cYou cannot set more than 3 homes!"
  99. stop
  100. size of {homes.%world%.%player%::*} is 5:
  101. player has permission "sk.sethome.infinite":
  102. if {%player%.%arg 1%.location} is set:
  103. message "&cThat home already exists!"
  104. else:
  105. add arg 1 to {homes.%world%.%player%::*}
  106. set {%player%.%arg 1%.location} to location of player
  107. wait 1 tick
  108. message "&6Set home &c%arg 1% &6 at location: &c%{%player%.%arg 1%.location}%"
  109. stop
  110. player does not have permission "sk.sethome.infinite":
  111. message "&cYou cannot set more than 5 homes!"
  112. stop
  113. command /home [<text>] [<text>]:
  114. permission: sk.home
  115. description: Teleport to a saved location!
  116. executable by: players
  117. trigger:
  118. if arg 2 is set:
  119. message "&cYour home can only be one word!"
  120. stop
  121. else if arg 1 is not set:
  122. if size of {homes.%world%.%player%::*} is 0:
  123. message "&cYou do not have any homes set!"
  124. else:
  125. message "&6Homes: &f%{homes.%world%.%player%::*}%"
  126. else if arg 1 is set:
  127. if {%player%.%arg 1%.location} is set:
  128. set {back.%player%} to location of player
  129. teleport player to {%player%.%arg 1%.location}
  130. message "&6Teleporting to home: &c%arg 1%"
  131. else:
  132. message "&cThat home does not exist!"
  133. command /delhome [<text>] [<text>]:
  134. permission: sk.home
  135. description: Delete a home.
  136. executable by: players
  137. trigger:
  138. if arg 2 is set:
  139. message "&cYour home can only be one word!"
  140. stop
  141. else if arg 1 is not set:
  142. message "&cYou must specify a home!"
  143. stop
  144. else if arg 1 is set:
  145. if {%player%.%arg 1%.location} is set:
  146. remove arg 1 from {homes.%world%.%player%::*}
  147. delete {%player%.%arg 1%.location}
  148. message "&6Home &c%arg 1% &6deleted."
  149. stop
  150. else if {%player%.%arg 1%.location} is not set:
  151. message "&cThat home does not exist!"
  152. stop
  153. command /homes:
  154. permission: sk.home
  155. description: List your homes.
  156. executable by: players
  157. trigger:
  158. if size of {homes.%world%.%player%::*} is 0:
  159. message "&cYou do not have any homes set!"
  160. else:
  161. message "&6Homes: &f%{homes.%world%.%player%::*}%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement