Zeldaboy111

Skript #195 - tycoonF

Jun 25th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 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. set {_iM::*} to {_i} split at "_machine"
  21. set {_item} to first character of {_iM::*} parsed as an item
  22.  
  23. replace "_machine" with " Machine" in {_i}
  24.  
  25.  
  26. add {_i} to {_i::*}
  27. loop {_i::*}:
  28. set {_i1} to first character of loop-value
  29. set {_i2} to last (length of loop-value - 1) characters of loop-value
  30. set {_i} to "%{_i1} to upper case%%{_i2}%"
  31.  
  32. give {_p} {_item}
  33.  
  34.  
  35. function openShop(p: Player, page: String):
  36. if {_page} is "machines":
  37. open chest with 3 rows named "&6Shop - Machines" to {_p}
  38. make gui slot 22 of {_p} with a barrier to close
  39. make gui slot 0 of {_p} with dirt named "&6Dirt Machine" to close then run function getItem(p, "dirt_machine")
Advertisement
Add Comment
Please, Sign In to add comment