I've been trying to make some sort of daily login bonus thing and I don't know how its not really working and I kinda get os.time but not really I tried getting the old time to compare from the new time and detect if its been 5 minutes or more.
--// Made by UltraUnitMode, 6/29/17
local Time = 300/60 -- 5 minutes
local DS = game:GetService('DataStoreService'):GetDataStore('TimeData')
local PS = game:GetService('Players')
game:BindToClose(function()
wait(3)
end)
PS.PlayerAdded:connect(function(Plr)
Key = Plr.UserId..'_Time'
local CHECK = DS:GetAsync(Key)
print(CHECK..' TIME')
if not CHECK then
local x = os.time()
DS:SetAsync(Key, os.time())
else
if CHECK < os.time()*Time then
print("It's been 5 mintues")
end
end
end)
PS.PlayerRemoving:connect(function(Plr)
local x = os.time()
DS:SetAsync(Key, x)
end)
