Okay, I think I accomplished something. Now I want to save using DataStore, but I don’t know where to start. I don’t know much about DataStore.
Here is the script:
local Tip = script.Parent
local startTime = os.time() -- Armazena o tempo inicial
local function disp__time(_time)
_time = _time - startTime -- Subtrai o tempo inicial
local days = math.floor(_time / 86400)
local hours = math.floor((_time % 86400) / 3600)
local minutes = math.floor((_time % 3600) / 60)
local seconds = math.floor(_time % 60)
if seconds == 60 then
seconds = 0
minutes = minutes + 1
end
if minutes == 60 then
minutes = 0
hours = hours + 1
end
if hours == 24 then
hours = 0
days = days + 1
end
local formattedTime = string.format("%d Days, %02d Hours, %02d Minutes, %02d Seconds", days, hours, minutes, seconds)
Tip.Text = "Play Time: " .. formattedTime
end
-- Atualize a cada segundo (ou o intervalo desejado)
while wait(1) do
disp__time(os.time()) -- Passe o tempo atual como argumento
end
Using the same topic to avoid opening another one******