Guest User

Untitled

a guest
May 1st, 2024
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.30 KB | None | 0 0
  1. on rightclick:
  2. if player's tool is {ChickenPet}, {CowPet} or {TigerPet} or {TurtlePet} or {GuardianPet} or {SharkPet} or {VillagerPet} or {BirdPet} or {EndermanPet} or {TimePet}:
  3. if difference between {PetSpawnCooldown::%UUID of player%} and now is less than 3 seconds:
  4. play sound "block.note_block.bass" with pitch 2 to player
  5. send "&9&lPETS: &7There is a &e3 seconds &7cooldown on using pets!" to event-player
  6. stop
  7. set {PetSpawnCooldown::%UUID of player%} to now
  8.  
  9.  
  10. if {SpawnedPet::%UUID of player%} is not set:
  11.  
  12. if player's z-coord is between 121 and 96:
  13. if player's x-coord is between 121 and 96:
  14. play sound "entity.chicken.egg" with pitch 1 to player
  15. play sound "entity.ender_dragon.flap" with pitch 2 to player
  16. play sound "entity.experience_orb.pickup" with pitch 2 to player
  17.  
  18. if player's tool is {ChickenPet}:
  19. send "&9&lPETS: &7You have spawned your &aChicken &7pet!" to player
  20. spawnpet(player, "Chicken")
  21. if player's tool is {CowPet}:
  22. send "&9&lPETS: &7You have spawned your &eCow &7pet!" to player
  23. spawnpet(player, "Cow")
  24. if player's tool is {TigerPet}:
  25. send "&9&lPETS: &7You have spawned your &6Tiger &7pet!" to player
  26. spawnpet(player, "Tiger")
  27.  
  28. if player's tool is {TurtlePet}:
  29. send "&9&lPETS: &7You have spawned your &aTurtle &7pet!" to player
  30. spawnpet(player, "Turtle")
  31. if player's tool is {GuardianPet}:
  32. send "&9&lPETS: &7You have spawned your &eGuardian &7pet!" to player
  33. spawnpet(player, "Guardian")
  34. if player's tool is {SharkPet}:
  35. send "&9&lPETS: &7You have spawned your &6Shark &7pet!" to player
  36. spawnpet(player, "Shark")
  37.  
  38. if player's tool is {VillagerPet}:
  39. send "&9&lPETS: &7You have spawned your &aVillager &7pet!" to player
  40. spawnpet(player, "Villager")
  41. if player's tool is {BirdPet}:
  42. send "&9&lPETS: &7You have spawned your &eBird &7pet!" to player
  43. send "&9&l- &7Flight mode has been enabled!" to player
  44. spawnpet(player, "Bird")
  45. set player's flight mode to true
  46. if player has permission "rank.coal":
  47. set player's flight speed to 0.3
  48. send "&9&l- &7Flight mode has been set to &fx2&7!" to player
  49. if player's tool is {EndermanPet}:
  50. send "&9&lPETS: &7You have spawned your &6Enderman &7pet!" to player
  51. spawnpet(player, "Enderman")
  52.  
  53. if player's tool is {TimePet}:
  54. send "&9&lPETS: &7You have spawned your <##f39de8>Time &7pet!" to player
  55. spawnpet(player, "Time")
  56. stop
  57.  
  58. play sound "block.note_block.bass" with pitch 2 to player
  59. send "&9&lPETS: &7You can only spawn pets in the /spawn region!" to event-player
  60. stop
  61.  
  62. if {SpawnedPet::%UUID of player%} is alive:
  63. if display name of {SpawnedPet::%UUID of player%} contains "Bird":
  64. set player's flight mode to false
  65. set player's flight speed to 0.2
  66. play sound "entity.item.pickup" with pitch 1 to player
  67. play sound "entity.ender_dragon.flap" with pitch 2 to player
  68. draw 25 poof at location 2.25 meters above {SpawnedPet::%UUID of player%} with offset vector(0, 0, 0) with extra 0.2
  69. kill {SpawnedPet::%UUID of player%}
  70. delete {SpawnedPet::%UUID of player%}
  71. send "&9&lPETS: &7You have de-spawned your pet!" to player
  72. stop
  73.  
  74.  
  75.  
  76.  
  77.  
  78. function spawnpet(p:player, t:text):
  79. wait 1 tick
  80. set {_uuidp} to UUID of {_p}
  81.  
  82. if {_t} is "Chicken" or "Cow" or "Tiger" or "Turtle" or "Guardian" or "Shark" or "Villager" or "Bird" or "Enderman" or "Time":
  83. spawn 1 armor stand at location 1 meters in front of {_p} with nbt from "{NoGravity:1b,Invulnerable:1,Invisible:1}"
  84.  
  85. if {_t} is "Chicken":
  86. set helmet of last spawned armor stand to {ChickenSkull}
  87. set display name of last spawned armor stand to "&a%{_p}% Chicken Pet"
  88. if {_t} is "Cow":
  89. set helmet of last spawned armor stand to {CowSkull}
  90. set display name of last spawned armor stand to "&e%{_p}% Cow Pet"
  91. if {_t} is "Tiger":
  92. set helmet of last spawned armor stand to {TigerSkull}
  93. set display name of last spawned armor stand to "&6%{_p}% Tiger Pet"
  94.  
  95. if {_t} is "Turtle":
  96. set helmet of last spawned armor stand to {TurtleSkull}
  97. set display name of last spawned armor stand to "&a%{_p}% Turtle Pet"
  98. if {_t} is "Guardian":
  99. set helmet of last spawned armor stand to {GuardianSkull}
  100. set display name of last spawned armor stand to "&e%{_p}% Guardian Pet"
  101. if {_t} is "Shark":
  102. set helmet of last spawned armor stand to {SharkSkull}
  103. set display name of last spawned armor stand to "&6%{_p}% Shark Pet"
  104.  
  105. if {_t} is "Villager":
  106. set helmet of last spawned armor stand to {VillagerSkull}
  107. set display name of last spawned armor stand to "&a%{_p}% Villager Pet"
  108. if {_t} is "Bird":
  109. set helmet of last spawned armor stand to {BirdSkull}
  110. set display name of last spawned armor stand to "&e%{_p}% Bird Pet"
  111. if {_t} is "Enderman":
  112. set helmet of last spawned armor stand to {EndermanSkull}
  113. set display name of last spawned armor stand to "&6%{_p}% Enderman Pet"
  114.  
  115. if {_t} is "Time":
  116. set helmet of last spawned armor stand to {GoldClockSkull}
  117. set display name of last spawned armor stand to "<##f39de8>%{_p}% Golden Clock"
  118.  
  119. set {_SpawnedPet::%{_uuidp}%} to last spawned armor stand
  120. teleport {SpawnedPet::%{_uuidp}%} to location 1 meters below {SpawnedPet::%{_uuidp}%}
Advertisement
Add Comment
Please, Sign In to add comment