Zeldaboy111

Skript #196 - tycoonF

Jun 26th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1.  
  2. function removeShop(p: Player, e: Entity, x: String, y: String, z: String, w: String):
  3.  
  4. if {Tycoon::shopLocations::*} doesn't contain "%{_w}% - %{_x}%, %{_y}%, %{_z}%":
  5. send "Cancelled" to {_p}
  6. stop
  7.  
  8. else:
  9. loop all villagers in radius 6 around {_p}:
  10. if "%location of loop-entity%" is "x: %{_x}%, y: %{_y}%, z: %{_z}%":
  11. set health of loop-entity to 0
  12. play "block_wood_hit" to {_p} at volume 10
  13. close {_p}'s inventory
  14.  
  15. remove "%{_w}% - %{_x}%, %{_y}%, %{_z}%" from {Tycoon::shopLocations::*}
  16.  
  17.  
  18. function getItem(p: Player, i: string):
  19. if {_i} contains "_machine":
  20.  
  21. set {_iM::*} to {_i} split at "_machine"
  22.  
  23. loop {_iM::*}:
  24. if loop-value doesn't contain "_machine":
  25. set {_item} to loop-value parsed as an item
  26.  
  27. replace "_machine" with " Machine" in {_i}
  28.  
  29.  
  30. add {_i} to {_i::*}
  31. loop {_i::*}:
  32. set {_i1} to first character of loop-value
  33. set {_i2} to last (length of loop-value - 1) characters of loop-value
  34. set {_i} to "%{_i1} to upper case%%{_i2} to lower case%"
  35.  
  36. set name of {_item} to "&6%{_i}%"
  37. set lore of {_item} to "&5Tycoon Machine"
  38. give {_p} {_item}
  39.  
  40.  
  41. function openShop(p: Player, page: String):
  42. if {_page} is "machines":
  43. open chest with 3 rows named "&6Shop - Machines" to {_p}
  44. make gui slot 22 of {_p} with a barrier to close
  45. make gui slot 0 of {_p} with dirt named "&6Dirt Machine" to close then run function getItem(p, "dirt_machine")
Add Comment
Please, Sign In to add comment