Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sellall(totalblocks: integer, price: integer) :: number:
- set {_result} to {_totalblocks} * {_price}
- return {_result}
- command /sellall:
- trigger:
- set {_cobble} to the amount of cobblestone in the player's inventory
- set {_coal} to the amount of coal in the player's inventory
- set {_iron} to the amount of iron ore in the player's inventory
- set {_gold} to the amount of gold ore in the player's inventory
- set {_redstone} to the amount of redstone in the player's inventory
- set {_lapis} to the amount of lapis in the player's inventory
- set {_diamond} to the amount of diamond in the player's inventory
- wait 1 tick
- set {_functiongive} to sellall({_cobble}, 1)
- add {_functiongive} to {%player%.tokens}
- send "%{_functiongive}% - funcgive, %{_cobble}% - cobble, %{%player%.tokens}%, -playertokens"
- wait 1 tick
- set {_functiongive} to sellall({_coal}, 3)
- add {_functiongive} to {%player%.tokens}
- send "%{_functiongive}% - funcgive, %{_coal}% - cobble, %{%player%.tokens}%, -playertokens"
- wait 1 tick
- set {_functiongive} to sellall({_iron}, 5)
- add {_functiongive} to {%player%.tokens}
- send "%{_functiongive}% - funcgive, %{_iron}% - cobble, %{%player%.tokens}%, -playertokens"
- wait 1 tick
- set {_functiongive} to sellall({_gold}, 6)
- add {_functiongive} to {%player%.tokens}
- send "%{_functiongive}% - funcgive, %{_gold}% - cobble, %{%player%.tokens}%, -playertokens"
- wait 1 tick
- set {_functiongive} to sellall({_redstone}, 4)
- add {_functiongive} to {%player%.tokens}
- send "%{_functiongive}% - funcgive, %{_redstone}% - cobble, %{%player%.tokens}%, -playertokens"
- wait 1 tick
- set {_functiongive} to sellall({_lapis}, 4)
- add {_functiongive} to {%player%.tokens}
- send "%{_functiongive}% - funcgive, %{_lapis}% - cobble, %{%player%.tokens}%, -playertokens"
- wait 1 tick
- set {_functiongive} to sellall({_diamond}, 8)
- add {_functiongive} to {%player%.tokens}
- send "%{_functiongive}% - funcgive, %{_diamond}% - cobble, %{%player%.tokens}%, -playertokens"
- wait 1 tick
- remove {_cobble} of cobblestone from player's inventory
- remove {_coal} of coal from player's inventory
- remove {_iron} of iron ore from player's inventory
- remove {_gold} of gold ore from player's inventory
- remove {_redstone} of redstone from player's inventory
- remove {_lapis} of lapis from player's inventory
- remove {_diamond} of diamond from player's inventory
- send "&7sold &3%{_cobble}% &7cobblestone"
- send "&7sold &3%{_coal}% &7coal"
- send "&7sold &3%{_iron}% &7iron ore"
- send "&7sold &3%{_gold}% &7gold ore"
- send "&7sold &3%{_redstone}% &7redstone"
- send "&7sold &3%{_lapis}% &7lapis"
- send "&7sold &3%{_diamond}% &7diamonds"
- if {%player%.tokens} > 1000:
- send "&aYou can now use /convert to get &6Playtime tokens!"
- stop
- if {%player%.tokens} < 1000:
- send "&cKeep it up! only need 1000 tokens for each &6Playtime token!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement