of     1   

C_Sharper
#183012565Friday, February 05, 2016 12:56 AM GMT

Ugh, I've been trying to solve for a long time now. I thought I fixed this issue. But I didn't. This is a daily rewards script. It worked when I first joined the game with no saved time value. It gave me the reward pack. But when I checked the frame to see when my next reward was, it was blank. 00:00:00. The time text updater works fine, it's not that. I rejoined the game to see that the next reward was coming in like 00:01:47.. What in the world? Please help me fix :( local ds = game:GetService("DataStoreService"):GetDataStore("DXD") local function GiveDailyReward(plr) local p = game.ReplicatedStorage.GUIs.DailyRewardPack:Clone() p.Parent = plr:WaitForChild("PlayerGui") end game.Players.PlayerAdded:connect(function(p) wait(1.5) local g = ds:GetAsync(p.userId) local t = Instance.new("NumberValue",p) t.Name = "Time" if g then local diff = (os.time() - g) if diff > 86400 then ds:SetAsync(p.userId,os.time()) elseif diff > 43200 then GiveDailyReward(p) ds:SetAsync(p.userId,os.time()) end else GiveDailyReward(p) ds:SetAsync(p.userId,os.time()) end wait(.5) t.Value = (os.time() - ds:GetAsync(p.userId)) end)
C_Sharper
#183012851Friday, February 05, 2016 1:01 AM GMT

I knew something was up with that last line of this code. I finally figured it out, hopefully for good! t.Value = (43200 - (os.time() - ds:GetAsync(p.userId)))

    of     1