Lava Titan
Developer
Hi, I made this globalevent script to send the storage timeleft but I guess the way I made it wont work as a globalevent, could someone help me fixing it?
Basicly I want to send text with timer to all players that got storage 999999...
Basicly I want to send text with timer to all players that got storage 999999...
Code:
function onThink(interval, lastExecution, thinkInterval)
local players = Game.getPlayers()
local uid = #players
local jogador = players[uid]
local H = os.date("%H", jogador:getStorageValue(999999) - os.time())
local M = os.date("%M", jogador:getStorageValue(999999) - os.time())
local S = os.date("%S", jogador:getStorageValue(999999) - os.time())
if #players > 0 then
if jogador:getStorageValue(999999) >= os.time() then
jogador:sendTextMessage(MESSAGE_INFO_DESCR, "Time Left: ".. H ..":".. M ..":".. S ..".")
end
end
return true
end
Last edited: