Angel Of Death
Rise Of Tibia ServerOwner
- Joined
- Mar 12, 2012
- Messages
- 91
- Reaction score
- 0
it doesnt work
the npc doesnt respond at all you say hi and he keeps walking around
the npc doesnt respond at all you say hi and he keeps walking around
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local storage = getPlayerStorageValue(cid, 60055)
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:setMessage(MESSAGE_GREET, "Greetings |PLAYERNAME|.")
function creatureSayCallback(cid, type, msg, item, fromPosition, itemEx, toPosition, uid)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, "Join")) then
if getPlayerSkullType(cid) =< 4 then
npcHandler:say( "Welcome", cid, 1000)
else
npcHandler:say( "What Are you Talking About!!!!" , cid, 1000)
end
elseif msgcontains(msg, "yes") then
if getPlayerSkullType(cid) =< 4 then
--Do Script Functions
else
npcHandler:say("I Havent Said AnyThing For You To Say Yes Too!!!", cid, 1000)
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Lua:
[Error - Npc interface]
data/npc/scripts/Dark BrotherHood.lua:onCreatureSay
Description:
data/npc/scripts/Dark BrotherHood.lua:17: attempt to call method 'getPlayerSkull
' (a nil value)
stack traceback:
data/npc/scripts/Dark BrotherHood.lua:17: in function 'getPlayerSkull'
data/npc/scripts/Dark BrotherHood.lua:32: in function 'callback'
data/npc/lib/npcsystem/npchandler.lua:383: in function 'onCreatureSay'
data/npc/scripts/Dark BrotherHood.lua:14: in function <data/npc/scripts/
Dark BrotherHood.lua:13>