• 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!

Solved Pull lever to buy a item

thedragon

New Member
Joined
Dec 1, 2012
Messages
12
Reaction score
0
i found a script on the forum:

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:
Back
Top