• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Display TimeLeft

Wiw3K

New Member
Joined
Apr 16, 2008
Messages
371
Reaction score
3
Distro: TFS 0.3.6
Tibia 8.6
Ok thread edit.
How i can display time left, this code gives me error.
Code:
local curtime = getGlobalStorageValue(1337)
local timeleft = curtime - os.time()
  
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Next lottery in: " ..os.time("%X", timeleft).. "")

Error:
Code:
[Error - TalkAction Interface]
data/talkactions/scripts/lottery.lua:onSay
Description:
data/talkactions/scripts/lottery.lua:8: bad argument #1 to 'time' (table expecte
d, got string)
stack traceback:
        [C]: in function 'time'
        data/talkactions/scripts/lottery.lua:8: in function <data/talkactions/sc
ripts/lottery.lua:1>
 
Last edited:
Back
Top