familychicken

Untitled

Jul 12th, 2023 (edited)
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.96 KB | None | 0 0
  1. variables:
  2. {%player%.adminmode} = false
  3.  
  4. on script load:
  5. set {res::1::*} to "&6木材", 0, (wooden pickaxe)
  6. set {res::2::*} to "&7石", 1, (stone pickaxe)
  7. set {res::3::*} to "&f鉄", 3, (iron pickaxe)
  8. set {res::4::*} to "&bダイヤモンド", 10, (diamond pickaxe)
  9. set {res::5::*} to "&eゴールド", 15, (golden pickaxe)
  10. set {res::6::*} to "&e金玉ウェポン", 0, (stone pickaxe)
  11.  
  12. options:
  13. exp1: &7&l&m=----------------
  14. xp: ✦
  15. rank: ❁
  16. t: ❃
  17. w: ✎
  18. pp: ☼
  19.  
  20. # ・経験値の質上昇
  21. # &6❃ 強化レベル&f: &f50 &7/ &f50
  22. # &3&l✎&r&7ランクアップに必要な経験値を減らす
  23. #┗効果: -(10*[level])
  24. # ►費用: 50.0M gold
  25.  
  26. command /newpickaxe:
  27. trigger:
  28. give player wooden shovel named "&8[❖] &fつるはし" with lore "&7》Qキーでアップグレード" with nbt "{toolowner:%player%}"
  29.  
  30. command /forge:
  31. trigger:
  32. if name of player's tool contains "[❖]":
  33. nsg_open("pickaxe", 1, 1, player)
  34. else:
  35. message "&7&o適正の道具を所持する必要がある..."
  36.  
  37.  
  38. command /status:
  39. trigger:
  40. message "&7》 &7所持エメラルド&f: &a%{%player%::emerald}% &a"
  41. message "&7》 &7exp per second(eps)&f: &3%nn({%player%::eps}, player)%"
  42. message "&7》 &7採掘抽選範囲&f: &e1 ~ %1000000/{%player%::mf}% &8(番号が小さいほどいいアイテムが出る) &3%nn({%player%::eps}, player)%"
  43.  
  44. on join:
  45. set {%player%::rank} to 0 if {%player%::rank} is not set
  46. set {%player%::xp} to 0 if {%player%::xp} is not set
  47. set {%player%::gold} to 0 if {%player%::gold} is not set
  48. set {%player%::pickaxe::res} to 1 if {%player%::rank} is not set
  49. set {%player%::upgrade::2x2} to 0 if {%player%::upgrade::2x2} is not set
  50. set {%player%::upgrade::3x3} to 0 if {%player%::upgrade::3x3} is not set
  51. set {%player%::upgrade::2x4} to 0 if {%player%::upgrade::2x4} is not set
  52. set {%player%::upgrade::3x2} to 0 if {%player%::upgrade::3x2} is not set
  53. set {%player%::upgrade::3x4} to 0 if {%player%::upgrade::3x4} is not set
  54. set {%player%::upgrade::1x1} to 0 if {%player%::upgrade::1x1} is not set
  55. set {%player%::upgrade::4x3} to 0 if {%player%::upgrade::4x3} is not set
  56. set {%player%::upgrade::4x2} to 0 if {%player%::upgrade::4x2} is not set
  57. set {%player%::upgrade::4x4} to 0 if {%player%::upgrade::4x4} is not set
  58.  
  59.  
  60.  
  61. function sg_itemset(name: text, loc: text, p: player) :: item:
  62. if {_name} is "pickaxe":
  63. set {_answer} to {_p}'s tool if {_loc} is "1x1"
  64. set {_answer} to sugar named "&7&m------------------" with lore "&7ピッケルレベル&f: &a%{%{_p}%::level}% レベル" and "&7&l┗&r&a + %{%{_p}%::level}% &a{@pp}" and "" and "" and "&l━━━━━━━━━━━━" and "&7合計ピッケルポイント&f: &a%{%{_p}%::totalpp}% &a{@pp}" if {_loc} is "2x1"
  65. if {_name} is "upgrade":
  66. set {_answer} to clay named " &7[1x3] ランクアップ経験値ダウン" with lore "&6{@t} &6強化レベル&f: &f%{%{_p}%::upgrade::%{_loc}%}% &7/ &f50" and "&3&l{@w} &r&7ランクアップに必要な経験値を減らす" and " &8&l┗ &r&7効果&f: &7needxp:&3 -(10*[level]) {@xp}" and "%mg_cost(2, 1.8, 50, {_loc}, ""gold"", {_p})%" with nbt "{loc:%{_loc}%}" if {_loc} is "1x3"
  67. set {_answer} to ghast tear named "&7[2x2] &7ランク・経験値間アップグレード" with lore "&6{@t} &6強化レベル&f: &f%{%{_p}%::upgrade::%{_loc}%}% &7/ &f1" and "&3&l{@w} &r&7ランクに応じて獲得経験値量が増加" and " &8&l┗ &r&7効果&f: &7xpmulti&3 +10log(rank+10) %% {@xp}" and "%mg_cost(750, 1.1, 1, {_loc}, ""gold"", {_p})%" with nbt "{loc:%{_loc}%}" if {_loc} is "2x2"
  68. set {_answer} to ghast tear named "&7[2x4] &7ランク・ゴールド間アップグレード" with lore "&6{@t} &6強化レベル&f: &f%{%{_p}%::upgrade::%{_loc}%}% &7/ &f1" and "&3&l{@w} &r&7ランクに応じて獲得ゴールド量が増加" and " &8&l┗ &r&7効果&f: &7goldgain: &e +8log(rank+10) %% &6gold" and "%mg_cost(3000, 1.1, 1, {_loc}, ""gold"", {_p})%" with nbt "{loc:%{_loc}%}" if {_loc} is "2x4"
  69. set {_answer} to mg_createitem("3x2", flint, "&7経験値倍率上昇Ⅰ", 20000, 1.2, 200, "gold", "&7経験値倍率を上昇させる", "&3+ 8*[level] %% &3{@xp}", {_p}, ("1x3", and "2x2"), (5, and 1)) if {_loc} is "3x2"
  70. set {_answer} to mg_createitem("3x4", gold nugget, "&7ゴールド倍率上昇Ⅰ", 15000, 1.15, 200, "gold", "&7ゴールド倍率を上昇させる", "&7gold gain: &e+ 5*[level] %%", {_p}, ("1x3", and "2x4"), (10, and 1)) if {_loc} is "3x4"
  71. set {_answer} to mg_createitem("3x5", gold ingot, "&aゴールド倍率上昇Ⅱ", 10000, 4, (10+{%{_p}%::upgrade::2x5}*5), "gold", "&7ゴールド倍率を上昇させる(乗算)", "&7goldmulti: &ex 1.5^[level]", {_p}, ("3x4", and "3x3"), (20, and 1)) if {_loc} is "3x5"
  72. set {_answer} to mg_createitem("2x5", gold block, "&9ゴールド倍率上昇Ⅱ+", 10^11, 100, 50, "gold", "&7「ゴールド倍率上昇Ⅱ」をさらに購入可能にする", "&7upg-3x5: &e上限増加 +5", {_p}, ("3x5", and "1x3"), (10, and 100)) if {_loc} is "2x5"
  73. set {_answer} to mg_createitem("3x3", iron pickaxe, "&7&nランク倍率上昇Ⅰ", 250000, 1000, 5, "gold", "&7ランクアップで上昇するランクが増加", "&7gainrank: &d+ 100*[level] %% &d{@rank}", {_p}, ("3x2", and "3x4"), (10, and 10)) if {_loc} is "3x3"
  74. set {_answer} to mg_createitem("4x3", dandelion, "&7幸運アップグレード", 1000000, 10, 4, "gold", "&7レアアイテムが採掘しやすくなる", "&7fortune: &ex(1.25*[level])", {_p}, ("1x3", and "3x3"), (10, and 1)) if {_loc} is "4x3"
  75. set {_answer} to mg_createitem("4x2", iron ingot, "&7&n経験値自動生成Ⅰ", 1000, 1.1, 1000, "rank", "&7経験値が離席中でも生成される", "&7xp: &3+2.0*[level] &3{@xp} / s", {_p}, ("4x3", and "3x2"), (1, and 20)) if {_loc} is "4x2"
  76. set {_answer} to mg_createitem("4x1", iron nugget, "&a経験値自動生成Ⅰ+(倍率)", 10000, 25, 20, "rank", "&7自動経験値の倍率を付与する", "&7epsmulti: (xpmulti)^(1-(0.8)^[level])", {_p}, ("4x2", and "3x2"), (3, and 25)) if {_loc} is "4x1"
  77. set {_answer} to stone pickaxe named "yukit復活 cost: 1e1.7e308" with nbt "{loc:%{_loc}%}" if {_loc} is "10x2"
  78. set {_answer} to maxbuy_guicreate({_p}) if {_loc} is "buy"
  79. set {_answer} to gray glass pane named "" if {_answer} is not set
  80. return {_answer}
  81.  
  82. function mg_createitem(loc: text, item: item, name: text, m: number, a: number, limit: number, c: text, lore: text, effect: text, p: player, conds: texts, conds2: numbers) :: item:
  83. if cu({_conds::*}, {_conds2::*}, {_p}) is true:
  84. set {_answer} to {_item} named "&7[&7%{_loc}%&7] %(colored {_name})%" with lore "&6{@t} &6強化レベル&f: &f%{%{_p}%::upgrade::%{_loc}%}% &7/ &f%{_limit}%" and "&3&l{@w} %(colored {_lore})%" and " &8&l┗ &r&7効果&f: %(colored {_effect})%" and "%mg_cost({_m}, {_a}, {_limit}, {_loc}, {_c}, {_p})%" with nbt "{loc:%{_loc}%}"
  85. else:
  86. loop (size of {_conds::*}) times:
  87. set {_text::%loop-number%} to "&8&l・ &7アップグレード[%{_conds::%loop-number%}%&7] &c%{%{_p}%::upgrade::%{_conds::%loop-number%}%}% &7/ &7%{_conds2::%loop-number%}% &7レベル"
  88. loop {_text::*}:
  89. set {_lore} to "%{_lore}%%nl%%loop-value%"
  90. set {_lore} to join {_text::*} by nl
  91. set {_answer} to gray wool named "&7[&7%{_loc}%&7] &7???" with lore "&c購入できる条件を満たしていません:" and "%{_lore}%"
  92. return {_answer}
  93.  
  94.  
  95.  
  96.  
  97. on inventory click:
  98. if name of clicked inventory contains "[・]":
  99. cancel event
  100. set {_item} to event-item
  101. set {_n} to tag "loc" of nbt of {_item}
  102. if name of clicked inventory contains "pickaxe":
  103. set {_a::1} to "pickaxe"
  104. set {_a::2} to 1
  105. if {_n} is "3x1":
  106. if {%player%::pp} >= {res::%{%player%::pickaxe::res}+1%::2}:
  107. remove {res::%{%player%::pickaxe::res}+1%::2}
  108. add {%player%::pickaxe::res} to 1 if {%player%::pickaxe::res} <= 5
  109. if name of clicked inventory contains "upgrade":
  110. set {_a::1} to "upgrade"
  111. set {_a::2} to 6
  112. if {_n} is "1x3":
  113. maxbuy_shop(2, 1.8, {%player%::upgrade::%{_n}%}, 50, "gold", player, {_n})
  114. if {_n} is "2x2":
  115. maxbuy_shop(750, 1.1, {%player%::upgrade::%{_n}%}, 1, "gold", player, {_n})
  116. if {_n} is "2x4":
  117. maxbuy_shop(3000, 1.1, {%player%::upgrade::%{_n}%}, 1, "gold", player, {_n})
  118. if {_n} is "3x2":
  119. maxbuy_shop(20000, 1.2, {%player%::upgrade::%{_n}%}, 200, "gold", player, {_n})
  120. if {_n} is "3x4":
  121. maxbuy_shop(15000, 1.15, {%player%::upgrade::%{_n}%}, 200, "gold", player, {_n})
  122. if {_n} is "3x3":
  123. maxbuy_shop(250000, 1000, {%player%::upgrade::%{_n}%}, 5, "gold", player, {_n})
  124. if {_n} is "4x3":
  125. maxbuy_shop(1000000, 10, {%player%::upgrade::%{_n}%}, 4, "gold", player, {_n})
  126. if {_n} is "4x2":
  127. maxbuy_shop(1000, 1.1, {%player%::upgrade::%{_n}%}, 1000, "rank", player, {_n})
  128. if {_n} is "4x1":
  129. maxbuy_shop(10000, 25, {%player%::upgrade::%{_n}%}, 20, "rank", player, {_n})
  130. if {_n} is "3x5":
  131. maxbuy_shop(10000, 4, {%player%::upgrade::%{_n}%}, 10+{%player%::upgrade::2x5}*5, "rank", player, {_n})
  132. if {_n} is "2x5":
  133. maxbuy_shop(10^11, 100, {%player%::upgrade::%{_n}%}, 50, "rank", player, {_n})
  134. if {_n} is "right":
  135. add 1 to {%player%.line::%{_a::1}%}
  136. sg_reload({_a::1}, {_a::2}, {%player%.line::%{_a::1}%}, player)
  137. else if {_n} is "left":
  138. add -1 to {%player%.line::%{_a::1}%} if {%player%.line::%{_a::1}%} > 1
  139. sg_reload({_a::1}, {_a::2}, {%player%.line::%{_a::1}%}, player)
  140. else if {_n} is "back":
  141. set {%player%.line::%{_a::1}%} to 1
  142. sg_reload({_a::1}, {_a::2}, {%player%.line::%{_a::1}%}, player)
  143. else if {_n} is "buy":
  144. add 1 to {%player%.guic}
  145. sg_reload({_a::1}, {_a::2}, {%player%.line::%{_a::1}%}, player)
  146. set slot (index of event-slot) of player's current inventory to sg_itemset({_a::1}, {_n}, player) if {_n} is set
  147. else:
  148. set slot (index of event-slot) of player's current inventory to sg_itemset({_a::1}, {_n}, player) if {_n} is set
  149. sg_reload({_a::1}, {_a::2}, {%player%.line::%{_a::1}%}, player)
  150.  
  151. function mg_mine(nr: number, gain: number, es: number, res: text, p: player):
  152. if {%{_p}%::rank} >= {_nr}:
  153. add 1 to {%{_p}%::miningcount::%{_res}%}
  154. if {%{_p}%::miningcount::%{_res}%} >= 1:
  155. add {_gain}*{%{_p}%::multixp} to {%{_p}%::xp}
  156. set {_r} to random integer between 1 and floor(1000000/{%{_p}%::mf})
  157. if {_res} is "obsidian":
  158. give obsidian named "&7黒曜石" with lore "{@exp1}" and "&7価値 &8> &e10K &6gold" with nbt "{sell:10000}" to {_p}
  159. give obsidian named "&7&n黒曜石" with lore "{@exp1}" and "&7価値 &8> &e20K &6gold" with nbt "{sell:20000}" to {_p} if {_r} is between 1 and 125000
  160. give obsidian named "&a黒曜石" with lore "{@exp1}" and "&7価値 &8> &e40K &6gold" with nbt "{sell:40000}" to {_p} if {_r} is between 1 and 31250
  161. give obsidian named "&9黒曜石" with lore "{@exp1}" and "&7価値 &8> &e160K &6gold" with nbt "{sell:160000}" to {_p} if {_r} is between 1 and 7813
  162. give obsidian named "&6黒曜石" with lore "{@exp1}" and "&7価値 &8> &e640K &6gold" with nbt "{sell:640000}" to {_p} if {_r} is between 1 and 1000
  163. if {_res} is "dirt":
  164. give dirt named "&7&n土" with lore "{@exp1}" and "&7価値 &8> &e0.1 &6gold" with nbt "{sell:0.1}" to {_p}
  165. give coarse dirt named "&7&n荒い土" with lore "{@exp1}" and "&7価値 &8> &e0.3 &6gold" with nbt "{sell:0.3}" to {_p} if {_r} is between 1 and 200000
  166. if {_res} is "sand":
  167. give sand named "&7&n砂" with lore "{@exp1}" and "&7価値 &8> &e0.5 &6gold" with nbt "{sell:0.5}" to {_p}
  168. give red sand named "&a&n赤砂" with lore "{@exp1}" and "&7価値 &8> &e2 &6gold" with nbt "{sell:2}" to {_p} if {_r} is between 1 and 200000
  169. give gold nugget named "&5&n砂金" with lore "{@exp1}" and "&7価値 &8> &e200K &6gold" and "&7&oとても砂の中にあったとは思えない" with nbt "{sell:200000}" to {_p} if {_r} is between 1 and 10
  170. if {_res} is "gravel":
  171. give gravel named "&7&n砂利" with lore "{@exp1}" and "&7価値 &8> &e3 &6gold" with nbt "{sell:3}" to {_p}
  172. give flint named "&2&n火打ち石" with lore "{@exp1}" and "&7価値 &8> &e100 &6gold" with nbt "{sell:100}" to {_p} if {_r} is between 1 and 50000
  173. if {_res} is "snow":
  174. give snow block named "&7雪" with lore "{@exp1}" and "&7価値 &8> &e5 &6gold" with nbt "{sell:5}" to {_p}
  175. give snowball named "&7&n雪玉" with lore "{@exp1}" and "&7価値 &8> &e30 &6gold" with nbt "{sell:30}" to {_p} if {_r} is between 1 and 150000
  176. give cobblestone named "&9石" with lore "{@exp1}" and "&7価値 &8> &e70K &6gold" and "&7&o?" with nbt "{sell:70000}" to {_p} if {_r} is between 1 and 100
  177. if {_res} is "stone":
  178. give stone named "&7石" with lore "{@exp1}" and "&7価値 &8> &e10 &6gold" with nbt "{sell:5}" to {_p}
  179. give cobblestone named "&7&n高品質な石" with lore "{@exp1}" and "&7価値 &8> &e300 &6gold" with nbt "{sell:300}" to {_p} if {_r} is between 1 and 150000
  180. give gray dye named "&7&n高品質な石" with lore "{@exp1}" and "&7価値 &8> &e300 &6gold" with nbt "{sell:300}" to {_p} if {_r} is between 1 and 10000
  181. if {_r} is 1:
  182. set {_r2} to random integer between 1 and 100
  183. if {_r2} is 1:
  184. give iron sword named "&e&k|||&r&6&l&n最強の意志&r&e&k|||" with lore "{@exp1}" and "&7価値 &8> &e%nn({_p}%::gold}, {_p})% &6gold" and "&7&oものすごく強い意志を感じる..." with nbt "{sell:%{%{_p}%::gold}%}" to {_p}
  185. else:
  186. give wooden sword named "&6意志" with lore "{@exp1}" and "&7価値 &8> &e5M &6gold" and "&7かなり強い意志を感じる..." with nbt "{sell:%{%{_p}%::gold}%}" to {_p}
  187. else:
  188. message "&7&oこれを採掘するには自分の力が弱すぎる..." to {_p}
  189.  
  190. function mg_cost(m: number, a: number, limit: number, loc: text, c: text, p: player) :: text:
  191. set {_answer::*} to (maxbuy_multibuy({_m}, {_a}, {%{_p}%.maxbuy}, {%{_p}%::upgrade::%{_loc}%}, {_limit}, {%{_p}%::%{_c}%}))
  192. return "&7&l ► &r&7費用&f: &e%nn({_answer::1}, {_p})% &6gold" if {_c} is "gold"
  193. return "&7&l ► &r&7費用&f: &d%nn({_answer::1}, {_p})% &d{@rank}" if {_c} is "rank"
  194.  
  195.  
  196. command /rankup:
  197. trigger:
  198. mg_rankup(player)
  199.  
  200.  
  201.  
  202.  
  203. #---====━━━━━━━━━━
  204.  
  205. every 2 ticks:
  206. loop all players:
  207. set {%loop-player%::needxp} to 1000-(10*(upg("1x3", loop-player)))
  208. set {%loop-player%::multixp} to 1 + 0.01*((upg("2x2", loop-player))*10*log({%loop-player%::rank}+10)+8*upg("3x2", loop-player))
  209. set {%loop-player%::multigold} to 1 + 0.01*((upg("2x4", loop-player))*8*log({%loop-player%::rank}+10)+5*(upg("3x4", loop-player)))
  210. set {%loop-player%::mf} to 1 + (0.25*upg("4x3", loop-player))
  211. set {%loop-player%::eps} to (({%loop-player%::multixp})^(1-(0.8)^upg("4x1", loop-player)))*2*(upg("4x2", loop-player))*{%loop-player%::multixp}
  212.  
  213. #---====━━━━━━━━━━
  214.  
  215. every 1 second:
  216. loop all players:
  217. add {%loop-player%::eps} to {%loop-player%::xp}
  218.  
  219.  
  220.  
  221. function upg(loc: text, p: player) :: number:
  222. set {_answer} to {%{_p}%::upgrade::%{_loc}%}
  223. return {_answer}
  224.  
  225. function mg_rankup(p: player):
  226. if {%{_p}%::xp} >= {%{_p}%::needxp}:
  227. set {_r} to floor({%{_p}%::xp}*(1/{%{_p}%::needxp}))
  228. remove {%{_p}%::needxp}*{_r} from {%{_p}%::xp}
  229. add {_r} * ({%{_p}%::upgrade::3x3}+1) to {%{_p}%::rank}
  230. message "&7ランクアップしました。 &d( +%nn({_r} * ({%{_p}%::upgrade::3x3}+1), {_p})% &d{@rank})" to {_p}
  231.  
  232. on break:
  233. if event-block is obsidian:
  234. set {_player} to random element of (all players)
  235. mg_mine(0, 100000, "obsidian", {_player})
  236. if event-block is dirt:
  237. mg_mine(0, 10, 0.01, "dirt", player)
  238. cancel event
  239. if event-block is sand:
  240. mg_mine(3, 20, 0.01, "sand", player)
  241. cancel event
  242. if event-block is gravel:
  243. mg_mine(15, 50, 0.03, "gravel", player)
  244. cancel event
  245. if event-block is snow block:
  246. mg_mine(50, 150, 0.01, "snow", player)
  247. if event-block is stone:
  248. mg_mine(10000, 3000, 0.05, "stone", player)
  249. cancel event
  250.  
  251.  
  252. every 2 ticks:
  253. loop all players:
  254. set name of sidebar of loop-player to ""
  255. set line 15 of loop-player's scoreboard to "&7&m------------------------------"
  256. set line 14 of loop-player's scoreboard to "&3経験値&f: &3%nn({%loop-player%::xp}, loop-player)% &3{@xp}"
  257. set line 13 of loop-player's scoreboard to "&7&l ┗&7倍率&f: &3x%{%loop-player%::multixp}%"
  258. set line 12 of loop-player's scoreboard to "&dランク&f: &d%nn({%loop-player%::rank}, loop-player)% &d{@rank}"
  259. set line 11 of loop-player's scoreboard to "&7&l ┗&7必要経験値&f: &3%{%loop-player%::needxp}% {@xp}"
  260. set line 10 of loop-player's scoreboard to "&6ゴールド&f: &e%nn({%loop-player%::gold}, loop-player)% &6gold"
  261. set line 9 of loop-player's scoreboard to "&7&l ┗&7倍率&f: &ex%{%loop-player%::multigold}%"
  262. set line 1 of loop-player's scoreboard to "&7&m------------------------------"
  263.  
  264. command /sell:
  265. trigger:
  266. loop 36 times:
  267. set {_item} to slot ((loop-number)-1) of player's inventory
  268. set {_n} to tag "sell" of nbt of {_item}
  269. if {_n} > 0:
  270. set {_item2} to {_item}
  271. remove {_item2} from player's inventory
  272. add (item amount of {_item2})*{_n}*{%player%::multigold} to {%player%::gold}
  273. add (item amount of {_item2})*{_n}*{%player%::multigold} to {_total}
  274. set {_n} to 0
  275. message "&7[&8・&7] &6+ &e%nn({_total}, player)% &6gold" to player if {_total} is set
  276.  
  277. command /ad-setupg <text> <number>:
  278. permission: skript.admin
  279. trigger:
  280. set {%player%::upgrade::%arg-1%} to arg-2
  281.  
  282. command /ad-mode:
  283. permission: skript.admin
  284. trigger:
  285. add 1 to {%player%.admodenum}
  286. set {%player%.adminmode} to true if mod({%player%.admodenum}, 2) is 1
  287. set {%player%.adminmode} to false if mod({%player%.admodenum}, 2) is 0
  288.  
  289. command /ad-setlv <text> <number>:
  290. permission: skript.admin
  291. trigger:
  292. set {%player%::%arg-1%} to arg-2
  293.  
  294. function cu(locs: texts, locsn: numbers, p: player) :: boolean:
  295. loop (size of {_locs::*}) times:
  296. if {%{_p}%::upgrade::%{_locs::%loop-number%}%} < {_locsn::%loop-number%}:
  297. return false
  298. return true
  299.  
  300. on place:
  301. if player's gamemode is not creative:
  302. cancel event
  303.  
  304. on break:
  305. if player's gamemode is not creative:
  306. cancel event
  307.  
  308.  
  309. function afktime(p: player) :: number:
  310. set {_uuid} to uuid of {_p}
  311. set {_n} to unix timestamp of now
  312. set {_afktime} to {_n}-{%{_uuid}%.lastlogin}
  313. return {_afktime}
  314.  
  315. on join:
  316. if {%uuid of player%.lastlogin} is set:
  317. set {_afktime} to afktime(player)
  318. set {_day} to floor({_afktime}/86400)
  319. set {_hour} to floor({_afktime}/3600)-24*{_day}
  320. set {_minset} to 1440*{_day}+60*{_hour}
  321. set {_minute} to floor({_afktime}/60)-{_minset}
  322. set {_secset} to 86400*{_day}+3600*{_hour}+60*{_minute}
  323. set {_second} to floor({_afktime})-{_secset}
  324. set {_daytext} to "%{_day}%日"
  325. set {_hourtext} to "%{_hour}%時間"
  326. set {_minutetext} to "%{_minute}%分"
  327. set {_secondtext} to "%{_second}%秒"
  328. set {_daytext} to "" if {_day} is 0
  329. set {_hourtext} to "" if {_hour} is 0
  330. set {_minutetext} to "" if {_minute} is 0
  331. set {_secondtext} to "" if {_second} is 0
  332. set {_awaytext} to "%{_daytext}%%{_hourtext}%%{_minutetext}%%{_secondtext}%"
  333. add {_afktime}*{%player%::eps} to {%player%::xp}
  334. add {_afktime}/86400 to {%player%::emerald}
  335. message "&7&oゲームデータを取得しています..."
  336. set {_gain::1} to {_afktime}*{%player%::eps}
  337. wait 60 ticks
  338. message "&7[&8&l・&r&7] &7あなたは &a%{_awaytext}% &7、放置していました。" to player
  339. message "&b{@w} &3+%nn({_gain::1}, player)% &3{@xp}" to player if {%player%::eps} > 0
  340. message "&b{@w} &a+ %{_afktime}/86400% &a❈"
  341.  
  342. on quit:
  343. set {%uuid of player%.lastlogin} to unix timestamp of now
  344.  
  345.  
Advertisement
Add Comment
Please, Sign In to add comment