Why is my daily system not working?

the default value for LastClaim is os.time()

		if sessionData[player.UserId].LastClaim < os.time() + 86400 then
			warn("Already Claimed!")
			return
		end

		sessionData[player.UserId].LastClaim = os.time()
		

Whats the Problem? I basically want it so you can claim if its your first time but if you’ve claimed before 24 hours then you shouldn’t be able to claim again

1 Like

Try using os.date instead beacuse thats the current time but os.time is something else

that returns a string so how would i add it to my code?

1 Like

Hmm maybe check out data time vars DateTime | Documentation - Roblox Creator Hub

so do you know what to actually use or are you just guessing?

1 Like

Well I am pretty confused cause don’t you need it to be a string?

im not really sure i dont see why i wouldn’t be able to use os.time()

if i used a string how would i know how long its been since the last login in 24:00:00 format

I may be wrong when im reading this but i think the error is where your using os.time() which is the current time then adding 86400 to it, try this instead

if sessionData[player.UserId].LastClaim + 86400 > os.time()  then
			warn("Already Claimed!")
			return
		end

		sessionData[player.UserId].LastClaim = os.time()

Also you want sessionData[player.UserId].LastClaim + 86400 to be bigger if you want to warn that the player has already claimed.

nvm this did work lol i had to put 86400 to 86500 and it worked

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.