• 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!

Lua Daily Chest (tinderbox)

Andronico

Member
Joined
Nov 13, 2010
Messages
82
Reaction score
12
Location
Chile
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

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"/>

56ee5bf87ddd8914914d5dc0263d54cb.jpg


 
This:
Code:
setPlayerStorageValue(cid, 13542, os.time() + 1 * 20 * 60 * 60 * 1000)

for this:
Code:
setPlayerStorageValue(cid, 13542, os.time()+20*3600)
 

Similar threads

Replies
0
Views
391
Back
Top