Can someone give me a click-and-buy system because i have been looking in here and in otfans and i just found by backpack.. i have one pretty easy to use but it works with backpacks can someone help me or fix the script?
like this
thank you
like this
PHP:
--Advanced container lever ( By Pitufo)
local items = {
[3456] = {itemId=7620, contMax=10, bp=2000, cost=2000, charges=15},
}
function onUse(cid, item, frompos, item2, topos)
if items[item.uid] then
if item.itemid == 1946 then
local v = items[item.uid]
if getPlayerFreeCap(cid) >= getItemWeightById(v.itemId, 20) then
if doPlayerRemoveMoney(cid, v.cost) == TRUE then
container = doPlayerAddItem(cid, v.bp, 1)
for i = 1, v.contMax do
if not(isItemRune(v.itemId)) then
doAddContainerItem(container, v.itemId, 1)
else
doAddContainerItem(container, v.itemId, v.charges)
end
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have but a container with "..getItemNameById(v.itemId)..".")
else
doPlayerSendCancel(cid, "Sorry, not enough money [Cost: "..v.cost.."].")
end
else
doPlayerSendCancel(cid, "Not enough cap [Cap needed: "..getItemWeightById(v.itemId, 20).."].")
end
doTransformItem(item.uid, item.itemid-1)
elseif item.itemid == 1945 then
doTransformItem(item.uid, item.itemid+1)
end
end
return 1
end
thank you