• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

(Lever) Double Cash Each Time

Black Dove

Web-Developer
Joined
Apr 14, 2010
Messages
129
Reaction score
4
Location
Egypt
Iam Searching For a Lever "Shop" That you Can Buy ( Item ID )
But Each Time You Buy it .. It Double Cash

For Example ...I Use Lever To Buy .. Demon Helmet By 1 kk "The Furst Time I Use"
"The Second Time I Use This Lever To buy Demon Helmet ... It Take 2kk
The Third = 4 kk
The Forth = 8 kk
etc ...

as limos also ask TFS Version :D
Iam Using TFS 0.3.6 (860)

That's All
ThanQ
 
Code:
local items = {
     [6501] = {itemid = 2493, price = 1000000, storage = 72001},
     [6502] = {itemid = 2498, price = 10000, storage = 72002},
     [6503] = {itemid = 2662, price = 5000, storage = 72003}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
     local x = items[item.uid]
     if getPlayerStorageValue(cid, x.storage) == -1 then
         setPlayerStorageValue(cid, x.storage, (x.price / 2))
     end
     if doPlayerRemoveMoney(cid, (getPlayerStorageValue(cid, x.storage) * 2)) then
         doPlayerAddItem(cid, x.itemid, 1)
         local info = getItemInfo(x.itemid)
         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought "..info.article.." "..info.name.." for "..(getPlayerStorageValue(cid, x.storage) * 2).." gold.")
         setPlayerStorageValue(cid, x.storage, (getPlayerStorageValue(cid, x.storage) * 2))
         doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW)
         doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
     else
         doPlayerSendCancel(cid, "You don't have enough money, you need "..(getPlayerStorageValue(cid, x.storage) * 2).." gold.")
         doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
     end
     return true
end
 
Code:
local items = {
     [6501] = {itemid = 2493, price = 1000000, storage = 72001},
     [6502] = {itemid = 2498, price = 10000, storage = 72002},
     [6503] = {itemid = 2662, price = 5000, storage = 72003}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
     local x = items[item.uid]
     if getPlayerStorageValue(cid, x.storage) == -1 then
         setPlayerStorageValue(cid, x.storage, (x.price / 2))
     end
     if doPlayerRemoveMoney(cid, (getPlayerStorageValue(cid, x.storage) * 2)) then
         doPlayerAddItem(cid, x.itemid, 1)
         local info = getItemInfo(x.itemid)
         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought "..info.article.." "..info.name.." for "..(getPlayerStorageValue(cid, x.storage) * 2).." gold.")
         setPlayerStorageValue(cid, x.storage, (getPlayerStorageValue(cid, x.storage) * 2))
         doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW)
         doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
     else
         doPlayerSendCancel(cid, "You don't have enough money, you need "..(getPlayerStorageValue(cid, x.storage) * 2).." gold.")
         doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
     end
     return true
end
i need to buy an item with out multiply money i mean i need to buy an item for 1kk each time not more
 
Remove
Code:
if getPlayerStorageValue(cid, x.storage) == -1 then
     setPlayerStorageValue(cid, x.storage, (x.price / 2))
end
And
Code:
setPlayerStorageValue(cid, x.storage, (getPlayerStorageValue(cid, x.storage) * 2))
Then change all
Code:
(getPlayerStorageValue(cid, x.storage) * 2)
To
Code:
x.price
 
Back
Top