Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Do Scripts run all at once I am trying to save os.time() to 2 datastores ?

So I was trying to save an ordered datastore with an value of os.time() and any key and a datastore with a key as os.time and any value

but If the os.time() on the ordered datastore dosen't match my datastore's os.time() its gonna mess up so I was wondering

if I should worry about this

1 answer

Even though os.time() returns the number of completed seconds since a decided time at a point of time, there's always a very small chance both scripts get os.time() on opposite sides of a second, making the data save a problem as the keys won't match. You can however use BindableEvents and do something like this:

-- Datasave 1
local t = os.time()
BindableEvent:Fire(t)

-- Datasave 2
BindableEvent.Event:Connect(function(t)
    -- Now both ts are the same
end)

1 comment

0

.Event, not .Fired

This discussion is preserved as it was. New answers, comments, and votes are closed.