Advertisement
AutismAlex

Untitled

May 13th, 2020
657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.39 KB | None | 0 0
  1. //created by Alex
  2.  
  3. //each command is limited to a certain value, i do not recommend going above this limit as the game can't always register it.
  4. //changing it is pretty self explanatory but i've made a comment to help
  5.  
  6.  
  7. command setSpeed(target,amount){
  8. permission = "setSpeed";
  9. execute(){
  10.  
  11. if(arguments.count < 2){
  12. player.message("<color=red>Proper Usage: /setSpeed <player> <amount></color>");
  13. return;
  14. }
  15.  
  16. if(amount > 10){ //max amt of speed, change this if you wish
  17. player.message(str.format("<color=red>The number {0} is greater than 10, please enter a number less than 10.</color>", amount));
  18. return;
  19. }
  20.  
  21. if(amount < 0 ){ // min amt of speed, change this if you wish
  22. player.message(str.format("<color=red>The number {0} is less than 0, please enter a number greater than 0.</color>", amount));
  23. return;
  24. }
  25.  
  26.  
  27. if(target != null){
  28. targetP = toPlayer(target);
  29. if(targetP != null){
  30. targetP.speed = amount;
  31. player.message(targetP.name + "'s speed has been set to " + targetP.speed);
  32. targetP.message("Your speed has been set to " + targetP.speed);
  33. return;
  34.  
  35.  
  36.  
  37. }
  38. else{
  39. player.message("<color=red>Couldn't find that player</color>");
  40. }
  41. }
  42. }
  43.  
  44. }
  45.  
  46.  
  47. command setJump(target,amount){
  48. permission = "setJump";
  49. execute(){
  50.  
  51. if(arguments.count < 2){
  52. player.message("<color=red>Proper Usage: /setJump <player> <amount></color>");
  53. return;
  54. }
  55.  
  56. if(amount > 10){ //max jump height, change this if you wish
  57. player.message(str.format("<color=red>The number {0} is greater than 10, please enter a number less than 10.</color>", amount));
  58. return;
  59. }
  60.  
  61. if(amount < 0 ){ //min jump height, change this if you wish, warning: i haven't tested what a minus jump height would do
  62. player.message(str.format("<color=red>The number {0} is less than 0, please enter a number greater than 0.</color>", amount));
  63. return;
  64. }
  65.  
  66.  
  67. if(target != null){
  68. targetP = toPlayer(target);
  69. if(targetP != null){
  70. targetP.jumpHeight = amount;
  71. player.message(targetP.name + "'s jump height has been set to " + targetP.jumpHeight);
  72. targetP.message("Your jump height has been set to " + targetP.jumpHeight);
  73. return;
  74.  
  75.  
  76.  
  77. }
  78. else{
  79. player.message("<color=red>Couldn't find that player</color>");
  80. }
  81. }
  82. }
  83.  
  84. }
  85.  
  86.  
  87. command setGrav(target,amount){
  88. permission = "setGrav";
  89. execute(){
  90.  
  91. if(arguments.count < 2){
  92. player.message("<color=red>Proper Usage: /setGrav <player> <amount></color>");
  93. return;
  94. }
  95.  
  96. if(amount > 10){
  97. player.message(str.format("<color=red>The number {0} is greater than 10, please enter a number less than 10.</color>", amount));
  98. return;
  99. }
  100.  
  101. if(amount < -10 ){
  102. player.message(str.format("<color=red>The number {0} is less than -10, please enter a number greater than 0.</color>", amount));
  103. return;
  104. }
  105.  
  106.  
  107. if(target != null){
  108. targetP = toPlayer(target);
  109. if(targetP != null){
  110. targetP.gravity = amount;
  111. player.message(targetP.name + "'s gravity has been set to " + targetP.gravity);
  112. targetP.message("Your gravity has been set to " + targetP.gravity);
  113. return;
  114.  
  115.  
  116.  
  117. }
  118. else{
  119. player.message("<color=red>Couldn't find that player</color>");
  120. }
  121. }
  122. }
  123.  
  124. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement