• 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] I Give Rep if you Fix Small Server Bug

Leo32

Getting back into it...
Joined
Sep 21, 2007
Messages
987
Solutions
14
Reaction score
532
I get random errors when i start my server (TFS).
All npc errors.

Sometimes i get them, and sometimes i dont get any. its really wierd.



PHP:
Lua Script Error: Warning: [NpcScript::NpcScript] Can not load script. [data/npc/scripts/seller.luaNPC interface 
] 

data/npc/scripts/distance.lua:onThink 
Warning: [NpcScript::NpcScript] Can not load script. data/npc/scripts/furniture.lua 

Stack size changed!

Sometimes i get those errors. And sometimes it just debugs after map loads. and sometimes it doesnt bug at all. it works perfect.

HELP!
 
Seller.lua NPC
PHP:
<?xml version="1.0"?>
<npc name="Robbie" script="data/npc/scripts/seller.lua" autowalk="1" floorchange="0" access="3">
 	<look type="143" head="95" body="132" legs="0" feet="0" />
	<parameters>
	<parameter key="message_greet" value="Hiho |PLAYERNAME|, I am a tools dealer, do you need any tools?" />
	<parameter key="message_farewell" value="Cya Later." />
	<parameter key="module_shop" value="1" />
	<parameter key="shop_buyable" value="pick,2553,50;shovel,2554,10;rope,2120,50;fishing rod,2580,150;machete,2420,80;backpack,1998,20" />
	</parameters>
</npc>



Seller.lua Script
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

npcHandler:addModule(FocusModule:new())

Furnitre NPC

PHP:
  <?xml version="1.0" ?> 
- <npc name="Vernie" script="data/npc/scripts/furniture.lua" autowalk="1" floorchange="0" access="3">
  <look type="144" head="96" body="132" legs="95" feet="0" /> 
- <parameters>
  <parameter key="message_greet" value="Hello, I sell tables, chairs, and lockers." /> 
  <parameter key="message_farewell" value="Come back soon." /> 
  <parameter key="module_shop" value="1" /> 
  <parameter key="shop_buyable" value="wooden chair,3901,30;sofa chair,3902,50;red cushioned chair,3903,40;green cushioned chair,3904,40;tusk chair,3905,45;big table,3909,60;square table,3910,45;small table,3912,55;round table,3911,75;tusk table,3914,65;stone table,3913,70;bamboo table,3919,50;locker,3934,40" /> 
  </parameters>
  </npc>

Furnite Script is the same as the seller.lua
 
No it's not the same

Yes the should be the same since the buying/selling it through the .xml file.
the only reason why the use an lua script like that for hi/bye/wait in line things like that.

Anywais try to use this as lua..

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

npcHandler:addModule(FocusModule:new())
 
Back
Top