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 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
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.
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.