Zeldaboy111

Skript #203 - tycoonF

Jul 9th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. options:
  2. prefix: &f[&2Tycoon&f] &8>>
  3. version: 1.0
  4.  
  5. function removeShop(p: Player, e: Entity, x: String, y: String, z: String, w: String):
  6.  
  7. if {Tycoon::shopLocations::*} doesn't contain "%{_w}% - %{_x}%, %{_y}%, %{_z}%":
  8. send "Cancelled" to {_p}
  9. stop
  10.  
  11. else:
  12. loop all villagers in radius 6 around {_p}:
  13. if "%location of loop-entity%" is "x: %{_x}%, y: %{_y}%, z: %{_z}%":
  14. set health of loop-entity to 0
  15. play "block_wood_hit" to {_p} at volume 10
  16. close {_p}'s inventory
  17.  
  18. remove "%{_w}% - %{_x}%, %{_y}%, %{_z}%" from {Tycoon::shopLocations::*}
  19.  
  20.  
  21. function getItem(p: Player, i: string):
  22. if {_i} contains "_machine":
  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} to lower case%"
  31.  
  32. set {_item} to paper named "&6%{_i}%" with lore "&5Tycoon Machine"
  33. send "{@prefix} &a%{_i}% &2gekocht!" to {_p}
  34. give {_p} {_item}
  35.  
  36.  
  37. function openShop(p: Player, page: String):
  38. if {_page} is "machines":
  39. open chest with 3 rows named "&6Shop - Machines" to {_p}
  40. make gui slot 22 of {_p} with a barrier named "&4Sluit menu" to close
  41. 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