//EDIT
I don't know how to add the storage value if the player is offline..
Hello everyone!
I have a problem.
How do I set time, so the player receives the storagevalue only after certain time?
for example in this script?
after I say yes or no it should pass x time before the player gets the storage
thanks alot
I don't know how to add the storage value if the player is offline..
Hello everyone!
I have a problem.
How do I set time, so the player receives the storagevalue only after certain time?
for example in this script?
Code:
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
local storage = 5006
function creatureSayCallback(cid, type, msg)
if msgcontains(msg, "hi") and (not npcHandler:isFocused(cid)) then
if getPlayerStorageValue(cid, storage) < 1 then
npcHandler:say("text?", cid, TRUE)
elseif getPlayerStorageValue(cid, storage) == 1 then
npcHandler:say("text.", cid, TRUE)
end
elseif msgcontains(msg, "yes") then
if getPlayerStorageValue(cid, storage) < 1 then
npcHandler:say("text.", cid, TRUE)
setPlayerStorageValue(cid, storage, 1)
end
elseif msgcontains(msg, "no") then
if getPlayerStorageValue(cid, storage) < 1 then
npcHandler:say(" text", cid, TRUE)
setPlayerStorageValue(cid, storage, 1)
end
elseif (not npcHandler:isFocused(cid)) then
return false
end
return true
end
npcHandler:setCallback(CALLBACK_FAREWELL, creatureFarewell)
npcHandler:setMessage(MESSAGE_WALKAWAY, "Good bye then.")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
Code:
setPlayerStorageValue(cid, storage, 1)
after I say yes or no it should pass x time before the player gets the storage
thanks alot
Last edited: