Tweening Clock Time Issue?

Hello,

So i am trying to create a ModuleScript called LightingService
but im having issues with the function i made call :CreateDayCycle()
Where it would Tween the number to 25,
ClockTime can never reach that number so when its Tweening, it will go forever when I call the function, But im getting confused when it doesn’t work all of a sudden,

I Have Tried:

  • Changing the Number

  • Adding a Infinite Repeat

  • Adding Another Tween following the Other

But None of these worked,

Instead it just fires once

can you help?

Server Script (ServerScriptService)

game.TweenService:Create(game.Lighting, TweenInfo.new(
	10,
	Enum.EasingStyle.Linear,
		Enum.EasingDirection.InOut
	),
		{ClockTime = 25}):Play() -- Should Repeat Without TimesRepeated but doesnt

I copy and pasted this exact piece of your script into my game and it worked
I think your issue isn’t very clear, the time (for me) goes up to 24 then it gets set to 0 after.

If the ClockTime can never reach 25, why is it being set to 25? Is it possible that another script is interfering with your ClockTime? Is this part of your script running at all?

I Only have 1 Script running, The reason its set to 25 and not 24 is because everytime i do, The Tween stops at 23.999

Just figured out that it’s not possible for the time to be set to 24. After 23.999, it just gets set to 0

That’s the point, It can never reach anything above 24, so It will repeat until it does which it never will

When I tested it, the tween stops right after it reaches 24. It never repeated itself afterwards

Your tween is only being played one time, right?

It is stated here:

No

Character Limit

I understand that, I did read your original post. I’m saying that there could be something else causing this issue which wasn’t mentioned in the original post since I’m not having the same issue with the script as you are

There is no other script but this one, I opened another place to test it to avoid that issue, I checked and no, Nothing Stopping it on the Module Script, nor the Script requiring it

Edit:
@9100ryan I added an Extra Detail:

I think thats already been done This Dev forum post should help

it has some information on how to make it stop and stuff

Thanks, but thats not what i want, i just want a simple Cycle that repeats

I’m pretty sure it does repeat forever I was talking about in the comments of that devfourm post

Yes, but read my post again before replying:

Edit:
Oh i see what you mean, but still, What is a fix to this besides other Scripts?

game.TweenService:Create(game.Lighting, TweenInfo.new(
	10,
	Enum.EasingStyle.Linear,
		Enum.EasingDirection.InOut
	),
		{ClockTime = 24 - 0.001}):Play() -- Should Repeat Without TimesRepeated

All you gotta do is make it very close to 24 to have it function.

Sorry, This just gives me the same result

Same Situation as here

Just create a function that plays tween and loop it everytime once the tween ends

I’m not sure I understand. Why should it repeat? A tween only interpolates a number or a data type a single time unless specified, and then it will stop when it’s done interpolating. It won’t repeat assigning a value to a property until it’s exactly equal. So you will need to use either a loop or set the repeat count to -1 for it to repeat.

if Lightning.ClockTime == 23.999 then
   Lightning.Clocktime = 24
end

Try to add this script, it will make the Tween go from 23.999 to 24 (i think, I never made it).

Bro, As Explained here:

Char Limit

1 Like

Yes, but that isn’t how it works. It doesn’t repeatedly assign a value to a property until the value of the property is exactly the same as the goal, it just interpolates a number (0) one single time to 25 and tries to apply it to the property. It doesn’t take into account the value of the property at any time except when the tween is first played.