how i can make the players receive tinder box every 20 hours?
I use this script but players can't take it after 20 hours
I use TFS 1.2
I use this script but players can't take it after 20 hours
I use TFS 1.2
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = {x=32085, y=31025, z=1}
local daily = getPlayerStorageValue(cid, 13543)
if (daily == -1) then
daily = 0
end
if getPlayerStorageValue(cid, 13542) - os.time() <= 0 then
doPlayerAddItem(cid, 22728)
setPlayerStorageValue(cid, 13542, os.time() + 1 * 20 * 60 * 60 * 1000)
doTeleportThing(cid,pos)
setPlayerStorageValue(cid, 13543, daily+1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have found " .. getPlayerStorageValue(cid, 13543) .. " tinder box.")
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "The pile of bones is empty, You must wait 20 hours to get your tinder box. Next avaiable will be at: " .. os.date("%H:%M:%S", getPlayerStorageValue(cid, 13542)) .. ".")
end
return true
end
Code:
<action uniqueid="22728" script="quests/chyllfroest/tinderBoxQuest.lua"/>