jpkulik
New Member
- Joined
- Mar 15, 2008
- Messages
- 208
- Reaction score
- 2
Hello all!
Im tryin to make and NPC. He needs to buy corpses.
Bug when i open the TFS i receie the following error:
There is the 2 scripts. (XML and LUA.)
Billy.xml
Rook_corpses.LUA
I hope someone know how to fix that.
Heheh, the idia is:
When players say 'Help' or 'offer', the NPC say: Im buying Corpses.
Tankyou everybody.
Cya!
OBS: Script for TFS
Im tryin to make and NPC. He needs to buy corpses.
Bug when i open the TFS i receie the following error:
I dont know why..data/npc/lib/npc.lua:9: bad argument #1 to 'find' (string expected, got nil)
[23/03/2008 15:45:23] Warning: [NpcScript::NpcScript] Can not load script. data/npc/scripts/rook_corpses.lua
There is the 2 scripts. (XML and LUA.)
Billy.xml
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Billy" script="data/npc/scripts/rook_corpses.lua" autowalk="1" floorchange="0">
<health now="100" max="100"/>
<look type="144" head="115" body="2" legs="114" feet="62" addons="1"/>
<parameters>
<parameter key="module_shop" value="1"/>
<parameter key="shop_sellable" value="rat,2813,2;dead rat,2813,2;wolf,2826,5;dead wolf,2826,5;rabbit,2992,2;dead rabbit,2992,2;dead rabbit,2992,2;minotaur leather,5878,12;bear paw,2992,10;spider,5896,3;dead spider,2992,3"/>
</parameters>
</npc>
Rook_corpses.LUA
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
if msgcontains(msg, 'help') or msgcontains(msg, 'offer') or msgcontains(msg, 'help') or msgcontains(msg, 'offer') then
npcHandler:say("Im buying Corpses.")
talkState = 0
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
I hope someone know how to fix that.
Heheh, the idia is:
When players say 'Help' or 'offer', the NPC say: Im buying Corpses.
Tankyou everybody.
Cya!
OBS: Script for TFS
Last edited: