Yeah so it works, you’ll just need to change the Speed variable in the function to whatever you want.
Yeah It does but only for the last time.
Yeah that’s what it’s set to? Only the last iteration
How do I set it to the 2nd time then?
I’m not sure what you mean? If you want it to slow down for more than the last one you would change the i == REPEAT
to something like i >= 3
so that means for 3 iterations it will be slow
1 Like
Ah I get what your saying now, thanks.
My wrong. I may have really forgotten to play the tweens.
1 Like
Hey uhm I was experimenting with a few different things but nothing really seemed to work, Is there any simple way to make it speed up after each time. Sorry for all the trouble.
If you want it to speed up each time you can simply just add values to the speed of each iteration.
-- Constants
local REPEAT = 5 -- Times you want it to repeat
-- Var
local SPEED = .4
local function Shake()
local Tween
for i = 1, REPEAT do
Tween = TweenService:Create(part, TweenInfo.new(SPEED, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, true), {Orientation = Vector3.new(0,0,30)})
Tween:Play()
Tween.Completed:Wait()
Tween = TweenService:Create(part, TweenInfo.new(SPEED, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, true), {Orientation = Vector3.new(0,0,-30)})
Tween:Play()
Tween.Completed:Wait()
SPEED += .1
end
end