Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Would I Get This OS Time Script To Run A Function On A Specific Time and Date?

Asked by
StoIid 364 Moderation Voter
7 years ago
Edited 7 years ago

I am trying to make something spawn into the game at a specific time on a specific date. I want to be able to edit when this happens.

Right now I have a basic OS script that shows the current time but that's it. This is a new topic to me and I've already read the wiki on OS time but still dunno how to exactly set the date. Any help?

Here is my code:

local TimeZone = -5
while true do
local A = math.fmod(tick(),86400)
local B = math.floor(A/3600) + 5 + TimeZone
local H = B
local M = math.floor(A/60 - 60*B)
local S = math.floor(math.fmod(A,60))
if string.len(H) == 1 then H = "0" .. H end
if string.len(M) == 1 then M = "0" .. M end
if string.len(S) == 1 then S = "0" .. S end
script.Parent.Time.Text = H .. ":" .. M .. ":" .. S
wait(1)
end

function SpawnIt()
    --Spawn the place in
end

Answer this question