piggybank.lua

main 13 lines · 400 bytes Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1function onUse(player, item, fromPosition, target, toPosition, isHotkey)
2 if math.random(6) == 1 then
3 item:getPosition():sendMagicEffect(CONST_ME_POFF)
4 player:addItem(ITEM_GOLD_COIN, 1)
5 item:transform(2115)
6 player:addAchievementProgress("Allowance Collector", 50)
7 else
8 item:getPosition():sendMagicEffect(CONST_ME_SOUND_YELLOW)
9 player:addItem(ITEM_PLATINUM_COIN, 1)
10 end
11 return true
12end
13
Top