For some odd reason, this script is not working.
What I want it to do is shoot this field and remove the item (2009) after use.
This is the error:
Thanks
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_NONE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_POFF)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLEARTH)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1505)
local area = createCombatArea(AREA_CIRCLE2X2)
setCombatArea(combat, area)
local function doRemoveObject(cid, pos)
local item1 = 2009
if(isPlayer(cid)) then
doRemoveItem(item1.uid)
return true
end
end
function onCastSpell(cid, var)
if(isPlayer(cid)) then
return doRemoveObject(cid, pos)
end
return doCombat(cid, combat, var)
end
What I want it to do is shoot this field and remove the item (2009) after use.
This is the error:
[05/05/2010 16:18:06] [Error - Spell Interface]
[05/05/2010 16:18:06] data/spells/scripts/flashbang.luanCastSpell
[05/05/2010 16:18:06] Description:
[05/05/2010 16:18:06] data/spells/scripts/flashbang.lua:13: attempt to index local 'item1' (a number value)
[05/05/2010 16:18:06] stack traceback:
Thanks