Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function removeShop(p: Player, e: Entity, x: String, y: String, z: String, w: String):
- if {Tycoon::shopLocations::*} doesn't contain "%{_w}% - %{_x}%, %{_y}%, %{_z}%":
- send "Cancelled" to {_p}
- stop
- else:
- loop all villagers in radius 6 around {_p}:
- if "%location of loop-entity%" is "x: %{_x}%, y: %{_y}%, z: %{_z}%":
- set health of loop-entity to 0
- play "block_wood_hit" to {_p} at volume 10
- close {_p}'s inventory
- remove "%{_w}% - %{_x}%, %{_y}%, %{_z}%" from {Tycoon::shopLocations::*}
- function getItem(p: Player, i: string):
- if {_i} contains "_machine":
- set {_iM::*} to {_i} split at "_machine"
- set {_item} to first character of {_iM::*} parsed as an item
- replace "_machine" with " Machine" in {_i}
- add {_i} to {_i::*}
- loop {_i::*}:
- set {_i1} to first character of loop-value
- set {_i2} to last (length of loop-value - 1) characters of loop-value
- set {_i} to "%{_i1} to upper case%%{_i2}%"
- give {_p} {_item}
- function openShop(p: Player, page: String):
- if {_page} is "machines":
- open chest with 3 rows named "&6Shop - Machines" to {_p}
- make gui slot 22 of {_p} with a barrier to close
- 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