local TS = game:GetServer("TweenService")
local newinfo = TweenInfo.new(
1, -- how much time does it take to completely change the values
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.In, -- EasingDirection
0, -- how many time it repeats (most use cases 0)
false, -- reverses?
0 -- delay
)
local tween = TS:Create(script.Parent.Parent["Buzzing Light"].PitchShiftSoundEffect.Octave, newinfo, {Value = 2}
tween:Play()
If you want a for loop this will do, but personally I would go for the TweenService
local pitchShiftSoundEffect = script.Parent.Parent["Buzzing Light"].PitchShiftSoundEffect
for i = 1, 2, 0.1 do
pitchShiftSoundEffect.Octave = i
task.wait(0.1)
end
Is there any way to stop this from stoping the whole task and it just moving on?
for i = 1, 2, 0.1 do
script.Parent.Attachment["Buzzing Light"].PitchShiftSoundEffect.Octave = i
wait(0.1)
end
for i = 1, 3, 0.1 do
script.Parent.Attachment.PointLight.Brightness = i
wait(0.1)
end
No, the for loop stops the task, is there a way to make it so it doesn’t stop the task, and both for loops happen at the same time instead of one happening, then waiting for it to finish, then the next one happening?
Just use coroutine, or task.spawn(), But like what I said before just use TweenService, this still gets the same effect and it already runs on a separate thread: