When changing the time multiplier, the time speed doesn't change

I’m making a day and night cycle. I added a time multiplier so when the player sleeps, the time goes faster instead of skipping to day.

The ServerScript is inside ServerScriptService.

the script:

local lighting = game:GetService("Lighting")

local multiplier = game:GetService("ReplicatedStorage"):WaitForChild('TimeMultiplier')

while wait() do
	lighting.ClockTime += 0.001 * multiplier.Value
end

So what issue do you have? You have not really explained what you need help with and what the issue is your trying to fix.

When i change the value of the multiplier the time speed doesn’t change, did you read the title?

Are you sure the multiplier’s value is actually changing?

I’m changing it manually to test

What is “TimeMultiplier”? and Int value? maybe you are missing .Value

it’s a number value, the issue is it doesn’t change in real-time, when i change the time multiplier before starting the game, it works

You are changing that value manually from Server or Client side?
Thats a Server script, reading an Int inside ReplicatedStorage, which is a bridge between Client and Server

2 Likes

that was actually it, when i changed the value on the server side it worked

1 Like

The title is not where you should be placing the description. The title should be a basic issue but then you should write the main issue in more details in the body of the post. I recommend checking the #help-and-feedback:scripting-support guidelines on how to write a post.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.