pele112
Member
Hello ! I Dont know why this script dont work
Error:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end
-- OTServ event handling functions end
function creatureSayCallback(cid, type, msg)
if(getPlayerStorageValue(cid,1337,1) then
local travelNode = keywordHandler:addKeyword({'idz'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'czy chcesz isc?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=437, y=505, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'To spierdalaj!'})
else
if(not npcHandler:isFocused(cid)) then
return FALSE
end
npcHandler.talkStart[cid] = os.time()
msg = string.lower(msg)
if msgcontains(msg, 'item') then
npcHandler:say('Dajesz to kurwa ?', cid)
talk_state[talkUser] = 1
elseif msgcontains(msg, 'yes') then
if talk_state[talkUser] == 1 then
if doPlayerRemoveMoney(cid,2391249) == TRUE then
setPlayerStorageValue(cid, 1337, 1)
npcHandler:say('Danke i spierdalaj.', cid)
else
npcHandler:say('nie masz kaski wiec spierdalaj', cid)
end
end
end
end
keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Mam nasrane w pale dej mi item'})
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
Error:
Last edited: