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:
Here's my script:
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
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