I wanna store the players join date (on my game, just the year, month and day) as well as keep track of their play time in seconds. Here’s what I got so far
Joined = {
Year = os.date("*t", os.time()).year,
Month = os.date("*t", os.time()).month,
Day = os.date("*t", os.time()).day,
},
PlayTime = 0,
And then my problem comes with tracking the total play time. For example, when a player joins
-- Setup extra values
local JoinTime = Instance.new('IntValue')
JoinTime.Name = 'JoinTime'
JoinTime.Value = os.time()
and then when they leave
-- Set PlayTime
PlayerData.PlayTime = PlayerData.PlayTime + os.difftime(os.time(), player.JoinTime.Value)
Is this the most efficient way of doing all this?