Changing IntValue Won't Work

I am trying to make a day/night cycle, and I’m trying to change an intvalue in the ReplicatedStorage. However, it’s not working.
The script:

local timevalue = game:GetService('ReplicatedStorage').TimeOfDay.Value



while true do
	if timevalue < 24 then
		print('timeup')
		timevalue = timevalue + 1
	else
		timevalue = 0
	end
	wait(1)
end

If anyone knows how to fix this, please respond, Thank you.

local timevalue = game:GetService(‘ReplicatedStorage’).TimeOfDay.Value

It should be:

local timevalue = game:GetService(‘ReplicatedStorage’).TimeOfDay

Then you can increase a number by doing this:

timevalue.Value = timevalue.Value + 1