Trouble with Real world time

I want to write a script in which my player will have a specific amount of life which resets after a day or it gets 1 life back after every hour. How do I achieve that? I also want it in such a way that players can’t get around with it by changing the time in their phone. Please help

The only way is to have a server giving time, since it would be a separate device not controled by users, you could reliably check the time.
You could probably use an api for syncronising time worldwide. Windows uses such api, juste have to find the one you want to use. The only prerequisite though is needing to be connected.

Edit : this made me curious so i did a quick search. Here you go : Time API List