RunarM
Finally back
Im looking for a script or something for my ots =)
Its like You buy things with Switch.
1945 -> 1946
Like this:::
Its like You buy things with Switch.
1945 -> 1946
Like this:::

local buyItem = 0
local price = 0
function onUse(cid, item, frompos, topos)
local money = crystalCoins * 10000 + platinumCoins * 100 + goldCoins
if item.actionId == 12345 then
buyItem = ITEMID --(CHANGE)
price = 1000 -- 1000 gp (CHANGE)
elseif item.actionId == 12346 then
buyItem = ITEMID2 --(CHANGE)
price = 1000 -- 1000 gp (CHANGE)
elseif item.actionId == 12347
buyItem = ITEMID3 --(CHANGE)
price = 1000 -- 1000 gp (CHANGE)
end
if item.itemid == 1945 then
if money >= price then
doPlayerAddItem(cid,buyItem,1)
doPlayerRemoveMoney(cid,price)
doTransformItem(item.uid,item.itemid + 1)
else
doPlayerSendTextMessage(cid,22,"You can't afford this.")
end
else
doTransformItem(item.uid,item.itemid - 1)
end
end
function onUse(cid, item)
if item.itemid == 1945 and item.actionid == 124214124 then
if doPlayerRemoveMoney(cid, 5000) == TRUE then
local container = doPlayerAddItem(cid, 2004, 1)
for i = 1, 20 do
doAddContainerItem(container, itemid, 1)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You do not have enough money.")
end
end
return TRUE
end