• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

NPC Skrypt przerobienie.

TriamerA

The Mystic One.
Joined
Nov 16, 2008
Messages
1,257
Reaction score
18
Location
Poland
Witam, ostatnimi czasy zacząłem bawić się trochę w Npc'ki, zrobiłem mniej więcej działające badziewie, ale ;D z tym npc nie rozmawia się na priv kanale. Prosiłbym jakiegoś miłego forumowicza o pomoc w przerobieniu.

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

function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, 'John is alive') then
queststatus = getPlayerStorageValue(cid,171717)
if queststatus == 1 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,1)
else
selfSay('How could you know that??!!')
end
end
if msgcontains(msg, 'Hell') then
queststatuss = getPlayerStorageValue(cid, 171718)
end
if queststatuss == 1 then
selfSay('Do you really want to travel to Hell??!!')
end
if msgcontains(msg, 'yes') then
local newPos = {x=100,y=100,z=7}
doTeleportThing(cid,newPos)
end







-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Back
Top