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

Npc error

Simoria

Hola at me
Joined
May 3, 2012
Messages
447
Reaction score
10
Location
Sweden
Hi . I tested to open the masiyah with rev 3884 and I get a error when I talk to a npc . and he wont talk to me
I use the liv from 3884 and it wont work :S ?
Any have a ide what it can be ?

error:
Code:
[22:28:40.245] [Error - NpcScript Interface] 
[22:28:40.245] data/npc/scripts/default.lua:onCreatureSay
[22:28:40.245] Description: 
[22:28:40.245] data/npc/lib/npc.lua:51: attempt to call global 'isValidPosition' (a nil value)
[22:28:40.245] stack traceback:
[22:28:40.245] 	data/npc/lib/npc.lua:51: in function 'getNpcDistanceTo'

Rep if you help me :)


Fix it
 
Last edited:
lib/032-position.lua add:

LUA:
function Position(x, y, z, stackpos)
        local position = {x = 0, y = 0, z = 0}
        if(isNumeric(x .. y .. z)) then
                position = {x = x, y = y, z = z}
                if(isNumeric(stackpos)) then
                        position.stackpos = stackpos
                end
        end

        return position
end

function isValidPosition(position)
        return (isNumeric(position.x .. position.y .. position.z) and position.x > 0
                and position.y > 0 and position.z >= 0 and position.z <= 15)
end
 
Back
Top