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

[Request] Use --> Get cash --> removes item used on!

Ranyo13

ManCausingMayhem
Joined
Aug 22, 2009
Messages
981
Reaction score
39
Hey otlanders,

I realy need an item that u right click then left click on another item, if the item u left click is in the table, u get the cash in the table next the itemid and the item removes!
Example for the table:
local items = [Paladin armor id, 2 cc]

action itemid = blessed wooden stake (id)

So better explanation, You right click the blessed wooden stake, left click on a p armor, the p armor disapears and u get 2cc

and more items

local items = [P armor, 20000,
Blue legs, 15000,
Crown shield, 2000
]
etc.. It shud be configurable so i cud add over 50 items, i hate npcs!
Thanks in advance and rep++ for who helps, i hope u understood what i wanted,
Ranyo13
 
looks like it's way too hard.. bring up my post, help please i realy need it badly, i will add reputation for who helps me 5x not only1 time..
 
Bump

EDIT: Ouch i didn't check the time.. Sorry, but can someone help me with this today please? It's the main source for selling custom items on my ot.
 
Bump
Looks like no one here is pro enuf to script it for me and get his reputation honestly
Im 100% sure it's possible to be scripted coz otmadness has it.
 
That will add it to the backpack instead of depot.

LUA:
local t = {
	[8891] = {2160, 2}, -- paladin armor ID, crystal coin ID, ammount.
}
   
function onUse(cid, item, fromPosition, itemEx, toPosition)
	for i, a in pairs(t) do
		if isInArray(i, itemEx.itemid) then
			local id = doCreateItemEx(a[1], a[2] or 1)
			if doPlayerAddItemEx(cid, id, false) ~= RETURNVALUE_NOERROR then
				doPlayerAddItem(cid, id)
			end
 
			doRemoveItem(itemEx.uid, 1)
			doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
			doCreatureSay(cid, "You have exchanged a " .. getItemInfo(i).name .. " for " .. a[2] .. " " .. getItemInfo(a[1]).name .. "" .. (a[2] > 1 and "s" or "") .. "!", TALKTYPE_MONSTER, nil, nil, toPosition.x == 0xFFFF and getThingPos(cid) or toPosition)
		else
			doSendMagicEffect(toPosition, CONST_ME_POFF)
			doCreatureSay(cid, "You cannot exchange this item!", TALKTYPE_MONSTER, nil, nil, toPosition.x == 0xFFFF and getThingPos(cid) or toPosition)
		end
	end
 
	return true
end
 
Back
Top