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
- function creatureSayCallback(cid, type, msg)
- if (npcHandler.focus ~= cid) then
- if msg == "hi" or msg == "hello" then
- if getPlayerStorageValue(cid, 59200) == -1 then
- npcHandler:say('random shit 1')
- talk_state = 1
- elseif getPlayerStorageValue(cid, 59200) == 1 then
- npcHandler:say('random shit 2')
- talk_state = 1
- else
- npcHandler:say('random shit 3')
- end
- NpcHandler:changeFocus(cid)
- else
- return false
- end
- elseif msgcontains(msg, "no") and talk_state == 1 then
- npcHandler:say('Fuck off.')
- talk_state = 0
- elseif msgcontains(msg, "bye") then
- npcHandler:say('Bye.')
- npcHandler:releaseFocus(cid)
- end
- return true
- end
- npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement