I was wondering how I could make my Time change GUI tween to make it look more smooth, just cause right now its an instant swap and can be spammed.
The local script is below V
local lighting = game.Lighting
local Button = script.Parent
Button.MouseButton1Click:Connect(function()
if lighting.ClockTime == 15 then
lighting.ClockTime = 16.5
else
lighting.ClockTime = 15
end
end)
(it changes only for the clients screen so it does not affect other players)
it would nice for the sun to tween down to the next position.
The number inside the TweenInfo argument is how long you want it to take for the Tween to complete, in my case I put 5 seconds, but you can put whatever you want.
Now, if you also want to prevent it from being spammed, you can use a sort of debounce variable, setting it to false when the player switches the time, only setting to true after Tween.Completed has fired, which can be done by doing Tween.Completed:Wait()