Daily Reward System?

I have kept on trying to make a daily system but keep failing and i tried to copy a video and that didnt work either

	if os.time() >= profile.Data.LastLogin then
		profile.Data.LastLogin = os.time() + 86400 -- respawn time
		CanGet = true
	else
		CanGet = false
	end

the errors i keep getting are compare string to number but i dont know how else to subtract the last login from the current time

1 Like

Have you tried tonumber()? [Assuming the lastlogin value is a string with numerals in it. ]

1 Like

os.time() returns a number right?

and LastLogin is equal to os.time() by default

Yes os.time() returns a number, the only reasonable problem here is that Profile.Data.LastLogin is not an integer value itself, can you send some background code regarding that value? I would recommend printing it beforehand to see what it is actually storing to find the issue

1 Like

i fixed it! i was just having trouble testing

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