Untitled
unknown
plain_text
a year ago
1.1 kB
3
Indexable
Never
local price_backpack = 1000 local exhaust_storage = 1111 --change this to an unused storage function onSay(player, words, param) local lastUse = player:getStorageValue(exhaust_storage) if lastUse > os.time() then player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendCancelMessage("Please wait 10 minutes before using this again!") return false end if player:removeMoney(price_backpack) then player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) player:addItem(2004, 1) player:setStorageValue(exhaust_storage, os.time() + 600) else if player:withdrawMoney(price_backpack) then if player:removeMoney(price_backpack) then player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) player:addItem(2004, 1) player:setStorageValue(exhaust_storage, os.time() + 600) end else player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendCancelMessage("You don't have enought money. Not even in your bank!") end end return true end