KylerXX
Active Member
- Joined
- Jun 24, 2010
- Messages
- 439
- Reaction score
- 30
Im trying to do a script that if you cast, creates on target if lookdir is north then this create an item in north, but doesn't work and I dont know why... here is the code:`
Here is the error:
[19/07/2010 21:08:59] Lua Script Error: [Spell Interface]
[19/07/2010 21:08:59] data/spells/scripts/summon/mrmime.luanCastSpell
[19/07/2010 21:08:59] luaGetCreaturePosition(). Creature not found
[19/07/2010 21:08:59] Lua Script Error: [Spell Interface]
[19/07/2010 21:08:59] data/spells/scripts/summon/mrmime.luanCastSpell
[19/07/2010 21:08:59] data/spells/scripts/summon/mrmime.lua:6: attempt to index a boolean value
[19/07/2010 21:08:59] stack traceback:
[19/07/2010 21:08:59] data/spells/scripts/summon/mrmime.lua:6: in function <data/spells/scripts/summon/mrmime.lua:3>
Please help!! Im a begginner on LUA
PHP:
function onCastSpell(cid, var)
local directions = {
[0] = {getCreaturePosition(getCreatureTarget(cid)).y - 1, 1987},
[1] = {getCreaturePosition(getCreatureTarget(cid)).x + 1, 1987},
[2] = {getCreaturePosition(getCreatureTarget(cid)).y + 1, 1987},
[3] = {getCreaturePosition(getCreatureTarget(cid)).x - 1, 1987}
}
local dir = getPlayerLookDir(cid)
if directions[dir] == getPlayerLookDir(cid) then
doCreateItem(directions[dir][2], 1, directions[dir][1])
return true
end
end
Here is the error:
[19/07/2010 21:08:59] Lua Script Error: [Spell Interface]
[19/07/2010 21:08:59] data/spells/scripts/summon/mrmime.luanCastSpell
[19/07/2010 21:08:59] luaGetCreaturePosition(). Creature not found
[19/07/2010 21:08:59] Lua Script Error: [Spell Interface]
[19/07/2010 21:08:59] data/spells/scripts/summon/mrmime.luanCastSpell
[19/07/2010 21:08:59] data/spells/scripts/summon/mrmime.lua:6: attempt to index a boolean value
[19/07/2010 21:08:59] stack traceback:
[19/07/2010 21:08:59] data/spells/scripts/summon/mrmime.lua:6: in function <data/spells/scripts/summon/mrmime.lua:3>
Please help!! Im a begginner on LUA