Error's.
Global.lua.
Script.
Whats wrong? =(
Code:
[02/06/2008 21:16:02] Lua Script Error: [CreatureScript Interface]
[02/06/2008 21:16:02] data/creaturescripts/scripts/tokens.lua
[02/06/2008 21:16:02] data/global.lua:669: attempt to index local 'pos' (a number value)
[02/06/2008 21:16:02] Warning: [Event::loadScript] Can not load script. data/creaturescripts/scripts/tokens.lua
Global.lua.
Code:
function isInArea(pos, fromPos, toPos)
if pos.x >= fromPos.x and pos.x <= toPos.x then
if pos.y >= fromPos.y and pos.y <= toPos.y then
if pos.z >= fromPos.z and pos.z <= toPos.z then
return true
end
end
end
return false
end
Script.
Code:
fromPos = {x=455, y=344, z=7}
toPos = {x=499, y=389, z=7}
local loot = 6527
if isInArea(getPlayerPosition(cid), fromPos, toPos) then
doPlayerAddItem(killer,loot,1)
end
Whats wrong? =(