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

lever for item

kilirt

New Member
Joined
May 11, 2009
Messages
223
Reaction score
2
sorry for too many request maybe :w00t: but i realy need all this script :)

i need a action script who do when i use a lever and if i've a special item i get an item :p
i've see the lever rune script but i'm confuse for change the money for item
 
LUA:
local t = {
	[search_id] = replace_id,
	[search_id] = replace_id,
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	for search, replace in pairs(t) do
		if doPlayerRemoveItem(cid, search, 1) then
			doPlayerAddItem(cid, replace, 1)
			local a, b = getItemInfo(search), getItemInfo(replace)
			doCreatureSay(cid, 'You exchanged ' .. a.article .. ' ' .. a.name .. ' for ' .. b.article .. ' ' .. b.name .. '.', TALKTYPE_ORANGE_1, false, cid)
			doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
			return true
		end
	end
	return doPlayerSendCancel(cid, 'You don\'t have any items to exchange.')
end
 
Mhmmm excuse me but what exactly i must modify?


if doPlayerRemoveItem(cid, search, 1) then
doPlayerAddItem(cid, replace, 1)

???
 
Dont touch script, here:
LUA:
local t = {
	[search_id] = replace_id,
	[search_id] = replace_id,
}

search_id = The ID of the "special" item that you have and you loose.
replace_id = The item you get
 
Use edit next time :p
Yea, you can add multiple here:
LUA:
local t = {
	[search_id] = replace_id,
	[search_id] = replace_id,
}

There you can put for 2 items,
You can add more like this
LUA:
local t = {
	[search_id] = replace_id,
	[search_id] = replace_id,
        [search_id] = replace_id,
}
 
Back
Top