I want to make it so you can claim it only once in less than 24 hours, once a day, and you can claim it again tomorrow and so on. but its not giving the reward. It has one issue its not giving me the reward.
local LastLogin = Profile.Data.LastLogin
local CurrentTime = os.time()
if LastLogin and LastLogin > 0 then
local OfflineTime = CurrentTime - LastLogin
if OfflineTime >= DailyOfflineInterval then
local GiveOfflineAmount = CalculateClicks(Player, Profile) * OfflineTime * 0.01
Profile.Data.Stats.TotalClicks += GiveOfflineAmount
Profile.Data.Stats.Clicks += GiveOfflineAmount
Player.Stats.TotalClicks.Value += GiveOfflineAmount
Player.Stats.Clicks.Value += GiveOfflineAmount
Profile.Data.LastLogin = os.time()
print("Player claimed offline reward for " .. GiveOfflineAmount .. " clicks.")
end
else
print("New Player")
Profile.Data.LastLogin = os.time()
end