Help with Offline Reward System

I am currently working on an offline reward system that rewards users based on their offline time. The system is designed to provide a reward to users once every 24 hours, with the amount of reward based on how long they were offline. However, I’m experiencing some issues with the current method and it’s not working as intended.

local CurrentTime = os.time()

    local LastLogin = Profile.Data.LastLogin
    
    if (LastLogin or 0) > 0 then

        local OfflineTime = CurrentTime - LastLogin

        if (OfflineTime / 3600) >= 24 then

            local CalculateOfflineReward = CalculateClicks(Player, Profile) * OfflineTime * 0.01


            Profile.Data.Stats.Clicks += CalculateOfflineReward
            Profile.Data.Stats.TotalClicks += CalculateOfflineReward

            Player.Stats.Clicks.Value += CalculateOfflineReward
            Player.Stats.TotalClicks.Value += CalculateOfflineReward

            print(CalculateOfflineReward)
            print(OfflineTime)


            Profile.Data.LastLogin = os.time()
            print(LastLogin)
        end 
    else
        print("New Player")
        Profile.Data.LastLogin = os.time()
    end

I hope you can help me

You need to be a lot more specific. What are the issues?

The issue is not giving the reward on the player

What does it print if you do print(OfflineTime) right after calculating your OfflineTime?

It doesn’t print anything it just prints new player then when I play the game second time it doesn’t print anything.