• 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
 
I'm using naxedot8 (8.6)

EDIT: And btw you didn't read all of my post, i said there's a table with items in it, only items u cud sell, not a parcel with a position lol

EDIT: i think i got what the script does, but still i dun want it to add the cash in the dp i want it to add the cash to the backpack...
 
Last edited:
:o but i dun want to have a mailbox in my map, honestly lol

EDIT: Plus i want it to check if the item is in the items table, if its not, it says You cannot sell this item.
 
Last edited:
You might get in trouble for bumping your thread several times in a row, even if it's unintentional.

I have fulfilled your request within my script above, check it out! New pictures have been added for your convenience.
 
I don't understand much but try put this on data/actions/scripts/tools/blessed_wooden_stake.lua. And i don't know if this work :p

LUA:
if itemEx.itemid == 2463 then -- plate armor
		doPlayerAddItem(cid, 2160, 2)
		doPlayerRemoveItem(cid, 2463, 1)
                doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
	elseif itemEx.itemid == 7730 then -- blue legs
		doPlayerAddItem(cid, 2160, 2)
		doPlayerRemoveItem(cid, 7730, 1)
                doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
	elseif itemEx.itemid == 2519 then -- crown shield
		doPlayerAddItem(cid, 2160, 2)
		doPlayerRemoveItem(cid, 2519, 1)
                doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
	end
 
@up Well, i will need to edit over 100 items, so editing 100 items to ur script will take like 2 hours, Plus J,dre script doesnt work for more than 1 item, if i have another item it tells me I cannot exchange this item. But it's in the table.
BUMP!
 
@up Well, i will need to edit over 100 items, so editing 100 items to ur script will take like 2 hours, Plus J,dre script doesnt work for more than 1 item, if i have another item it tells me I cannot exchange this item. But it's in the table.
BUMP!

Maybe you failed at editing it, post the script that you're trying to use.(yes, there's a link to it, but maybe you made a mistake at adding the item.)
 
Code:
local t = {
	[3971] = {9970, 5},
	[2652] = {9970, 5}
}
 
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)
			doPlayerAddItemEx(cid, id, true) 
 
		                doRemoveItem(itemEx.uid, 1)
			doSendMagicEffect(toPosition, 14)
			doSendAnimatedText(toPosition, "$$$", TEXTCOLOR_LIGHTGREEN)
			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
 
		break
	end
 
	return true
end
I Removed the mailbox part and added 1 more item..
 
Back
Top