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

Lua NPC Does not work... [SOLVED]

Glidarn

Member
Joined
May 9, 2009
Messages
970
Reaction score
16
Location
Åkersberga, Sweden
I've tried the premium support but with no success so as my last shot here i'm turning to you guys...

AS the title says my npcs does not respond they are just walking around and i'm getting this error in the console Imageshack - npcnewlib.png

I have searched around for like 3 days now checked almost all the threads about this but i've found nothing so... does anyone know what the problem is?


SOLVED, Solution:

(npchandler.lua)

replace:
LUA:
function NpcHandler:isInRange(cid)
		local distance = getDistanceTo(cid) or -1
		if(distance == -1) then
			return false
		end
 
		return (distance <= self.talkRadius)
	end

with:
LUA:
function NpcHandler:isInRange(cid)
		local distance = getDistanceBetween(getCreaturePosition(getNpcCid()), getCreaturePosition(cid))
		if(distance == -1) then
			return false
		end
 
		return (distance <= self.talkRadius)
	end
 
Last edited:
Back
Top