Getting the amount of time since a player spawned?

I’m wondering if it’s even possible to detect if a player has recently spawned. I’m thinking I could use a CharacterAdded function, but that won’t work for the first time it should be called, as it’s running in a LocalScript. If anybody could help, that’d be awesome.

you can do it on PlayerAdded as well as CharacterAdded then

                 local LastSpawned = os.time()
                 --// set this value to an Int Value object, so you can index this
                 local IntValue ="IntValue")
                 --// the value would have to exist already,
                 --// not each time a player respawns (demonstration)
                 IntValue.Value = LastSpawned
                 IntValue.Parent = player

to get the time since a player last spawned, do this

 print(os.time() - IntValue.Value)