Change something every hour the player plays

I want to make a system where something changes every hour that the players play. I don’t want it to run while player is not on server. How would I do this.

thanks

1 Like

Most basically, it should look like this.

game.Players.PlayerAdded:Connect(function(player)
     while task.wait(3600) and player do --Does the waiting, as well as making it stop when the player leaves.
         --Stuff you need to do goes here
     end
end)

In the future, please look for a tutorial first online as I am sure there are many related to this.