Witam Podratuje mnie ktoś i poprawi co źle bo już nie mam pojęcia jak ustawić ten Addevent.
W całym skrypcie chodzi dokładnie o te linie:
A oto błąd z konsolki:
Cały NPC:
W całym skrypcie chodzi dokładnie o te linie:
addEvent(setPlayerStorageValue, 2*60*1000, 17101, -1, cid)
addEvent(setPlayerStorageValue, 2*60*1000, 17103, 1, cid)
A oto błąd z konsolki:
Cały NPC:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local price = 5000
local talkState = {}
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
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'secret') and getPlayerStorageValue(cid,17100) >= 0 and getPlayerStorageValue(cid,17101) <= 0 and getPlayerStorageValue(cid,17103) <= 0 and getPlayerMoney(cid) >= 5000) then
npcHandler:say("XXX1", cid)
talkState[talkUser] = 2
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then
if getPlayerStorageValue(cid,17101) >= 1 then
npcHandler:say("XXX2", cid)
else
if getPlayerStorageValue(cid,17100) >= 0 and getPlayerStorageValue(cid,17101) <= 0 and getPlayerStorageValue(cid,17103) <= 0 and getPlayerMoney(cid) >= 5000 then
npcHandler:say('XXX3', cid)
doPlayerRemoveMoney(cid,price)
doSendMagicEffect(getCreaturePosition(cid), 13)
setPlayerStorageValue(cid,17101,1)
setPlayerStorageValue(cid,17111,1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Your quest log has been updated")
addEvent(setPlayerStorageValue, 2*60*1000, 17101, -1, cid)
addEvent(setPlayerStorageValue, 2*60*1000, 17103, 1, cid)
else
npcHandler:say("XXX4", cid)
end
end
elseif(msgcontains(msg, 'no') and talkState[talkUser] == 2) and getPlayerStorageValue(cid,17100) >= 0 and getPlayerStorageValue(cid,17101) <= 0 and getPlayerStorageValue(cid,17103) <= 0 and getPlayerMoney(cid) >= 5000 then
npcHandler:say("XXX5", cid)
else
if(msgcontains(msg, 'no') and talkState[talkUser] == 2) and getPlayerStorageValue(cid,17100) >= 0 and getPlayerStorageValue(cid,17101) >= 1 and getPlayerStorageValue(cid,17103) <= 0 then
npcHandler:say("XXX6", cid)
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())