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

błąd z npc pilne!

Indenpedens

Banned User
Joined
Nov 6, 2010
Messages
584
Reaction score
39
Location
Poland
witam wywala mi taki blad w silniku co chwila
Code:
[29/06/2012 18:47:49] Lua Script Error: [Npc interface] 
[29/06/2012 18:47:49] data/npc/scripts/boat_porthope.lua:onThink

[29/06/2012 18:47:49] luaGetDistanceTo(). Thing not found

[29/06/2012 18:47:49] Lua Script Error: [Npc interface] 
[29/06/2012 18:47:49] data/npc/scripts/boat_porthope.lua:onThink

[29/06/2012 18:47:49] luaGetCreatureName(). Creature not found

[29/06/2012 18:47:49] Lua Script Error: [Npc interface] 
[29/06/2012 18:47:49] data/npc/scripts/boat_porthope.lua:onThink

[29/06/2012 18:47:49] data/npc/lib/npcsystem/npchandler.lua:301: bad argument #3 to 'gsub' (string/function/table expected)
[29/06/2012 18:47:49] stack traceback:
[29/06/2012 18:47:49] 	[C]: in function 'gsub'
[29/06/2012 18:47:49] 	data/npc/lib/npcsystem/npchandler.lua:301: in function 'parseMessage'
[29/06/2012 18:47:49] 	data/npc/lib/npcsystem/npchandler.lua:539: in function 'onWalkAway'
[29/06/2012 18:47:49] 	data/npc/lib/npcsystem/npchandler.lua:474: in function 'onThink'
[29/06/2012 18:47:50] 	data/npc/scripts/boat_porthope.lua:11: in function <data/npc/scripts/boat_porthope.lua:11>

uzywam 0.3.4pl2
 
normalne jak kazde inne ;/
Code:
local keywordHandler = KeywordHandler:new()
        local npcHandler = NpcHandler:new(keywordHandler)
        NpcSystem.parseParameters(npcHandler)
        
        
        
        -- OTServ event handling functions start
        function onCreatureAppear(cid)				npcHandler:onCreatureAppear(cid) end
        function onCreatureDisappear(cid) 			npcHandler:onCreatureDisappear(cid) end
        function onCreatureSay(cid, type, msg) 	npcHandler:onCreatureSay(cid, type, msg) end
        function onThink() 						npcHandler:onThink() end
        -- OTServ event handling functions end
        
        
        -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
        
	local travelNode = keywordHandler:addKeyword({'edron'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Edron for 140 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 140, destination = {x=33175, y=31764, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
	local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Venore for 150 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 150, destination = {x=32954, y=32022, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
	local travelNode = keywordHandler:addKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Thais for 150 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 150, destination = {x=32311, y=32210, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
	local travelNode = keywordHandler:addKeyword({'ankrahmun'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Ankrahmun for 100 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 100, destination = {x=33092, y=32883, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
	local travelNode = keywordHandler:addKeyword({'darashia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Darashia for 170 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 170, destination = {x=33289, y=32481, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

	local travelNode = keywordHandler:addKeyword({'liberty bay'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Liberty Bay for 40 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 40, destination = {x=32285, y=32891, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

	local travelNode = keywordHandler:addKeyword({'yalahar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Yalahar for 250 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 250, destination = {x=32803, y=31272, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

        
        -- Makes sure the npc reacts when you say hi, bye etc.
        npcHandler:addModule(FocusModule:new())
 
kurna samo to ze prosisz mnie o npchandler widac ze wiedza nie bardzo i nie jestes w stanie mi pomoc
czekam na kogos bardziej zaawansowanego
 
kurna samo to ze prosisz mnie o npchandler widac ze wiedza nie bardzo i nie jestes w stanie mi pomoc
czekam na kogos bardziej zaawansowanego

Lol ale z ciebie noob bład jest w npchandler, a jezeli nie chcesz abysmy ci pomogli to nie dawaj
 
1. podmień swoje start shity na moje:

na samej górze wjeb:
Lua:
	  -->  seminari_system_podrozy  <--
      -- ~~~~~~~~ By Seminari ~~~~~~ --
      --          //// | \\\\        --
      --         / __     __ \       --
      --         |[*]  |  [*]|       --
      --         |     ^     |       --
      --          \ \_____/ /        --
      --           --\___/--         --
      --           \______/          --
      -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ --
      

-- start shit
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
 
function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)        npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                            npcHandler:onThink() end
--returns how many msgs he have said already
function cancelNPCTalk(events)
  local ret=1
  for aux=1,table.getn(events) do
     if events[aux].done==FALSE then
        stopEvent(events[aux].event)
     else
        ret=ret+1
     end
  end
  events=nil
  return(ret)
end
 
function doCreatureSayWithDelay(cid,text,type,delay,e)
   if delay<=0 then
      doCreatureSay(cid,text,type)
   else
      local func=function(pars)
                    doCreatureSay(pars.cid,pars.text,pars.type)
                    pars.e.done=TRUE
                 end
      e.done=FALSE
      e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e})
   end
end

function doGADAJ_ALOT(cid,delay,messages)
        for i = 1,#messages do
            addEvent(doCreatureSay,delay * i, getNpcCid(), messages[i], TALKTYPE_PRIVATE_NP, false, cid)
        end
end  

function doNPCTalkALot(msgs,interval)
  local e={}
  local ret={}
  if interval==nil then interval=3000 end --3 seconds is default time between messages
  for aux=1,table.getn(msgs) do
      e[aux]={}
      doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux])
      table.insert(ret,e[aux])
  end
  return(ret)
end
--end shit :P





function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end      
-- zmienne lokalne
   local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
    local namee = getPlayerName(cid)



	

		

			

local msgss = ''
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

	--npc_name = getCreatureName(getNpcCid())
	
	local function getCurrentNPCName ()
		name = getCreatureName(getNpcCid())
		return name
	end


dolne dwie linijki (na samym dole wjeb)
Lua:
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())



2. Jeśli punkt 1 Ci nie pomógł to wklej mi plik .xml twojego npca, z którym masz problem
 
Back
Top