Players.PlayerAdded:Connect(function(player)
timeTrack[player] = tick()
LoadPlayerData(player)
end)
Players.PlayerRemoving:Connect(function(player)
print("Player data exist ["..player.Name.."]")
local TotalSeconds = tick() - timeTrack[player]
timeTrack[player] = nil
local TotalMinutes = (TotalSeconds - TotalSeconds % 60) / 60
local TotalHours = TotalMinutes/60
print(TotalMinutes)
print(TotalHours)
local Leaderstats = player:FindFirstChild("Leaderstats")
if Leaderstats then
print("leadestats found")
local TimePlayed = Leaderstats:FindFirstChild("TimePlayed")
if TimePlayed then
print("timeplayed exist")
TimePlayed.Value = TotalHours
print(TimePlayed.Value)
print("doing math")
end
end
CheckPlayerData(player)
end)
is there way that i can get total hour as (0.8) (0.9) (0.3) instead of 0 or 0.033333333 or some random huge numbers? because I want minutes to be calculated too along with hours
i am trying to make it look like to steam hours time played something similar as this