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

getItemStackable issue

dave182

New Member
Joined
Jan 23, 2009
Messages
80
Reaction score
3
Well, I don't know if I have to post it here, I was making a script so the potions can be bought by pulling a lever and also they get stackable, so no need of BPs. The script works good, but everytime I pull the lever, an error message is send to my console, saying this:

Code:
[07/10/2010 14:07:07] [Error - Action Interface] 
[07/10/2010 14:07:07] data/actions/scripts/tools/healthpotion.lua:onUse
[07/10/2010 14:07:07] Description: 
[07/10/2010 14:07:07] data/actions/scripts/tools/healthpotion.lua:14: attempt to call global 'getItemStackable' (a nil value)
[07/10/2010 14:07:07] stack traceback:
[07/10/2010 14:07:07] 	data/actions/scripts/tools/healthpotion.lua:14: in function <data/actions/scripts/tools/healthpotion.lua:7>

Here's my script:
Code:
        hp_id = 7618 -- Item a ser vendido
		custohp_id = 900 -- Valor
		cargashp_id = 20 -- Cargas

local name = getItemNameById(hp_id)
----- End Config -----
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if doPlayerRemoveMoney(cid, custohp_id) == TRUE then
                        doSendAnimatedText(fromPosition, "Bought", TEXTCOLOR_YELLOW)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custohp_id .." gold.")
						for i=1,20 do
			doPlayerAddItem(cid,7618,20)
	if isItemStackable(7618) then
		getItemStackable(7618)
                end
	end
                else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custohp_id .." gold coins for a backpack of ".. name .."s.")
                end
        return FALSE
end

It works properly, but that annoying message appears everytime i pull the lever. I've tried with everything, so I decided to ask here. Thanks
 
nothng is called "getItemStackable(7618)" lol thre is no such function


so just remove these 3 lines
Code:
if isItemStackable(7618) then
		getItemStackable(7618)
                end
 
But, if I remove them, when I pull the lever the potions arent stackable, I mean, in the way of appearing X20 potions, there appears 20 potions separated
 
lol .....

This just do nothng , as it say in the error , this is a unexisted function that not effect the script except by giving error to the console.
 
It does give an effect, I tried removing that part u said and reloading actions, but when I erase that, there appears 20 X20 potions separated in the way of 1 slot of X20.
 
Back
Top