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

[Help] A script

furstwin

New Member
Joined
Aug 9, 2007
Messages
486
Reaction score
1
Location
Sweden
Error's.
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? =(
 
try this:
PHP:
local fromPos = {x=455, y=344, z=7}
local toPos = {x=499, y=389, z=7}
local loot = 6527
if isInArea(getCreaturePosition(cid), fromPos, toPos) then
doPlayerAddItem(killer,loot,1)
end
 
Last edited:
Code:
[03/06/2008  12:49:07] Lua Script Error: [CreatureScript Interface] 
[03/06/2008  12:49:07] data/creaturescripts/scripts/tokens.lua

[03/06/2008  12:49:07] luaGetCreaturePosition(). Creature not found

[03/06/2008  12:49:07] Lua Script Error: [CreatureScript Interface] 
[03/06/2008  12:49:07] data/creaturescripts/scripts/tokens.lua

[03/06/2008  12:49:07] data/global.lua:669: attempt to index local 'pos' (a number value)
[03/06/2008  12:49:07] Warning: [Event::loadScript] Can not load script. data/creaturescripts/scripts/tokens.lua
 
Back
Top