CyberShaman21
New Member
- Joined
- Dec 9, 2017
- Messages
- 52
- Reaction score
- 4
Hi
I use tfs 1.2
I wonder, how to make fix for npc.
I want to make npc say something at times.
i add voices from monster
but dosen't work
i found in orts server this:
server/data/npc/scripts/Obi.lua
i try to copy this and add to TFS 1.2 but i get error.
I copy folder lib from npc folder(orts) ind paste to tfs 1.2 and still errors
What i need to fix?
I use tfs 1.2
I wonder, how to make fix for npc.
I want to make npc say something at times.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="xxx" script="xxx.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100" />
<look type="132" head="20" body="39" legs="45" feet="7" addons="0" />
<parameters>
<parameter key="module_shop" value="1" />
<parameter key="shop_buyable" value="parcel,2595,15;letter,2597,10" />
</parameters>
</npc>
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="xxx" script="xxx.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100" />
<look type="132" head="20" body="39" legs="45" feet="7" addons="0" />
<parameters>
<parameter key="module_shop" value="1" />
<parameter key="shop_buyable" value="parcel,2595,15;letter,2597,10" />
</parameters>
<voices interval="10" chance="100000">
<voice sentence="Ranat Ulderek!" />
<voice sentence="Orc buta bana!" />
<voice sentence="Ikem rambo zambo!" />
<voice sentence="Futchi maruk buta!" />
</voices>
</npc>
i found in orts server this:
server/data/npc/scripts/Obi.lua
Code:
local voices = {
{ text = 'Only quality steel and wood used for my weapons!' },
{ text = 'Buy your weapons here!' },
{ text = 'Selling and buying all sorts of weapons, come and have a look!' },
{ text = 'Give those monsters a good whipping with my weapons!' }
}
npcHandler:addModule(VoiceModule:new(voices))
i try to copy this and add to TFS 1.2 but i get error.
Code:
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())
local voices = {
{ text = 'Only quality steel and wood used for my weapons!' },
{ text = 'Buy your weapons here!' },
{ text = 'Selling and buying all sorts of weapons, come and have a look!' },
{ text = 'Give those monsters a good whipping with my weapons!' }
}
npcHandler:addModule(VoiceModule:new(voices))
What i need to fix?