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

How do I save players names and time when they joined my game?

Asked by 8 years ago

I want to save players names and the time and day they joined my game I Try to use DataStoreService but I don't know how to get the time and day when the players join's my game any ideas on how I can save names of players who played my game and time and day? is there a function that can get the time?

0
I think you can try os.time() or something... I don't know, I can never figure out time. I tried getting a time gui and it was so complex I almost fell asleep lightpower26 399 — 8y
0
os.time() only gives me hours,mines, sec I need days,hours,mins,sec WITKOSKI 2 — 8y
0
BTW I am looking for a saving system WITKOSKI 2 — 8y
0
I think tick uses local time zones for clocks? LifeInDevelopment 364 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Use tick() in a local script to return you with a Player's local time.

I did the basic math here for you, this will print your current time if used in a local script.

    local a = tick()
    local hour = math.floor(a/60/60%24)
    local minute = math.floor(a/60%60)
    local second = math.floor(a%60)

    print(hour..":"..minute..":"..second)
Ad

Answer this question