So I want to make 2 npcs connected with themselfs.
First one should be like
And the second one should be like
Rep++ for help, and I think that those scripts could be a thing which some people were looking for.
First one should be like
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandlerCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlerCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlerCreatureSay(cid, type, msg) end
function onThink() npcHandlerThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, 'help') then
selfSay('Do you want to help me??.')
if msgcontains(msg, 'yes') then
selfSay('You will have to tell my brother that I am still alive, he is selling jelewery in Thais.')
setPlayerStorageValue(cid, 171717)
else
selfSay('Then do not waste my time!!')
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
And the second one should be like
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandlerCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlerCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlerCreatureSay(cid, type, msg) end
function onThink() npcHandlerThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, 'John is alive') then
elseif getPlayerStorageValue(cid, valueid) == 171717 then
selfSay('Oh thank you, I though he was dead!! So what would you like to get as a reward?? Hmm I can take you to the terrain of the Hell. If you want ask me for.')
setPlayerStorageValue(cid, 171718)
else
selfSay('How could you know that??!!')
if msgcontains(msg, 'Hell')
elseif getPlayerStorageValue(cid, valueid)
== 171718 then
doTeleportThing(cid, newpos[, pushmove]) // how to teleport a player somewhere then?
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Rep++ for help, and I think that those scripts could be a thing which some people were looking for.