undead mage
Active Member
So I tryd this script that when you say the word "join" to the npc that the npc will say "I grant you acces to the warzones!" and set your storage to (87816, 1). But nothing is happening when im saying "join" to the npc. Also how can I make words that the npc says dark blue? So ppl know that that's a word that the npc responds to? @Xeraphus
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 function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local player = Player(cid)
if(msgcontains(msg, "join")) then
npcHandler:say("I grant you acces to the warzones!", cid)
player:setStorageValue(87816, 1)
npcHandler.topic[cid] = 0
end
return true
end