i found a script on the forum:
but where must i put this script to let it work i want that my players can buy donation items via the lever that for example for one thing is the price than 1000cc for example.
and also where must i put this script to let the hole thing work ( i want more things with the lever how can i make it so i can make more items work )
thx!.
Lua:
function onUse(cid, item, frompos, item2, topos)
local config = {
item_id = 2565, -- here past item id which you are selling
count_of_item = 1, -- here past count of item id which you are selling
how_much_cost = 50 -- here past price, now it means 50 gold coins.
}
if doPlayerRemoveMoney(cid, config.how_much_cost) == false then
doPlayerSendCancel(cid, "Sorry, you don't have enough money.")
return true
end
if doPlayerRemoveMoney(cid, config.how_much_cost) then
doPlayerAddItem(cid, config.item_id, config.count_of_item)
doPlayerSendTextMessage(cid, 25, "You bought " .. config.count_of_item .. "x of " .. getItemNameById(config.item_id) .. " for " .. config.how_much_cost .. " gold coins.")
return true
end
return true
end
but where must i put this script to let it work i want that my players can buy donation items via the lever that for example for one thing is the price than 1000cc for example.
and also where must i put this script to let the hole thing work ( i want more things with the lever how can i make it so i can make more items work )
thx!.
Last edited by a moderator: