Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- shopp: &7[&7&l・&r&7]
- on join:
- set {%player%.maxbuy} to 0
- set {%player%.multibuy} to 1
- function sp(p: player, startp: number, power: number, upgn: number, type: text, max: number, mbuy: number):
- loop {_max}+1 times:
- if {_max} is not 0:
- set {_mbuy} to 2^({_max}-loop-number+1)
- set {_cost} to multibuy({_mbuy}, {_startp}, {_power}, {_upgn}, {_p})
- if {_type} is "upgrade":
- if {%{_p}%.coin} >= {_startp}:
- if {%{_p}%.upgrade::%{_upgn}%} is not 1:
- remove {_startp} from {%{_p}%.coin}
- set {%{_p}%.upgrade::%{_upgn}%} to 1
- add {_startp} to {%{_p}%.legacycoin}
- message "{@shopp} &f購入に成功しました。" to {_p}
- exit loop
- else:
- message "{@shopp} &7購入済みです。" to {_p}
- exit loop
- else if {_type} is "buyable":
- if {%{_p}%.coin} >= {_cost}:
- add {_mbuy} to {_suc}
- add {_cost} to {%{_p}%.legacycoin}
- remove {_cost} from {%{_p}%.coin}
- add {_mbuy} to {%{_p}%.upgrade::%{_upgn}%}
- message "{@shopp} &f購入に成功しました。" to {_p} if {_max} is 0
- else:
- set {_need} to {_cost}-{%{_p}%.coin}
- message "{@shopp} &7費用が足りません。 あと &f%nn({_need}, {_p})% &7coins必要です。&8(%{%{_p}%.coin}/{_cost}*100% &8%%)" to {_p} if {_max} is 0
- if {_max} is not 0:
- if {_suc} > 0:
- message "{@shopp} &f購入に成功しました。 &7(&f%{_suc}%&7)" to {_p} if {_mbuy} is 1
- else:
- set {_need} to {_cost}-{%{_p}%.coin}
- message "{@shopp} &7十分なお金を持っていません。 あと &f%nn({_need}, {_p})% &7coins必要です。&8(%{%{_p}%.coin}/{_cost}*100%&8%%)" to {_p}
- command /setmaxbuy <integer>:
- trigger:
- if arg-1 >= 0:
- if arg-1 is not 0:
- set {%player%.maxbuy} to 0
- set {%player%.multibuy} to arg-1
- message "&7[&8・&7] &7同時購入回数を &f%arg-1% &7にしました。"
- if arg-1 is 0:
- set {%player%.maxbuy} to 15
- message "&7[&8・&7] &7同時購入回数を &fmax &7にしました。"
- else:
- message "&7[&8・&7] &c正の整数のみ入力可能"
- function multibuy(mbuy: number, startp: number, power: number, upgn: number, p: player) :: number:
- set {_wn} to {_startp}*({_power}^({%{_p}%.upgrade::%{_upgn}%}+{_mbuy})-{_power}^{%{_p}%.upgrade::%{_upgn}%})/({_power}-1)
- return {_wn}
- function maxbuy_guicreate(n: number, p: player):
- set {_show} to coloured "&7現在の設定: x%{%{_p}%.multibuy}%" if {%{_p}%.maxbuy} is 0
- set {_show} to coloured "&7現在の設定: すべて購入" if {%{_p}%.maxbuy} is not 0
- set slot {_n} of {_p}'s current inventory to iron nugget named "&8&l・&7同時購入 &fx1" with lore {_show}
- set slot {_n}+1 of {_p}'s current inventory to iron ingot named "&8&l・&7同時購入 &fx10" with lore {_show}
- set slot {_n}+2 of {_p}'s current inventory to iron block named "&8&l・&7同時購入 &fx100" with lore {_show}
- set slot {_n}+3 of {_p}'s current inventory to bone block named "&8&l・&7すべて購入" with lore {_show}
- on i
Advertisement
Add Comment
Please, Sign In to add comment