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

Pull lever, get item

Entral

C
Joined
May 1, 2009
Messages
371
Reaction score
0
Location
Sweden
Hello! i would like to have a script, that if you pull a lever, you get an item... and it´s gonna cost some money :)
is there any script out there that can do that :?
thanks
 
Lua:
local config = {
	item = {<itemid>, <count>}
	cost = XXX,
} -- config end --

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if doPlayerRemoveMoney(cid, config.cost) == TRUE then
		doPlayerAddItem(cid, config.item[1], config.item[2])
		doPlayerSendTextMessae(cid, 18, "You bought "..config.item[2].."x "..getItemNameById(config.item[1]).." for "..config.cost.." gold coins.")
	else
		doPlayerSendTextMessae(cid, 18, "You need "..config.cost.." gold coins for "..config.item[2].."x "..getItemNameById(config.item[1])..".")
	return TRUE
end

:thumbup:
 
Back
Top Bottom