fork download
  1. local RewardTime = 24*60*60 --How often they get the reward in seconds --This is 24 hours
  2.  
  3. local DataStore = game:GetService("DataStoreService"):GetDataStore("LastLogin")
  4. local Player = script.Parent.Parent.Parent.Parent
  5. local LastLogin = DataStore:GetAsync(Player.userId) or os.time()
  6.  
  7. while true do
  8. Seconds = RewardTime-(os.time()-LastLogin);
  9. Minutes = Seconds/60;
  10. Hours = Minutes/60;
  11. script.Parent.Text = ("Time Until Next Reward: %02d:%02d:%02d"):format(Hours,Minutes%(60),Seconds%(60))
  12. wait(1)
  13. end
Runtime error #stdin #stdout #stderr 0s 2784KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
lua: prog.lua:3: attempt to index global 'game' (a nil value)
stack traceback:
	prog.lua:3: in main chunk
	[C]: in ?