Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- local storage = 10001
- function creatureSayCallback(cid, type, msg)
- if (npcHandler.focus ~= cid) then
- return false
- end
- if msgcontains(msg, 'hi') then
- if getPlayerStorageValue(cid, 1) == 1 then
- npcHandler:say('Hello')
- talk_state = 1
- else
- npcHandler:say('Fuck off')
- end
- elseif msgcontains(msg, 'djanni\'hah') then
- npcHandler:say('Splendid! Here take your pickaxe.')
- talk_state = 1
- elseif msgcontains(msg, 'mission') and talk_state == 1 then
- npcHandler:say('you want a mission?')
- talk_state = 2
- elseif msgcontains(msg, 'yes') and talk_state == 2 then
- npcHandler:say('Okay then.')
- talk_state = 3
- end
- end
- npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
- npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement