So I'm making an AFK game and I have the script working:
function onPlayerEntered(newPlayer) local stats = Instance.new("IntValue") stats.Name = "leaderstats" local secs = Instance.new("IntValue") secs.Name = "Time Played" secs.Value = 0 secs.Parent = stats stats.Parent = newPlayer while true do wait(1) secs.Value = secs.Value + 1 end end game.Players.ChildAdded:connect(onPlayerEntered)
But somehow I can't figure out how to store it, anyone can tell me how or why?