Hi,
I am trying to tween a part forward and bounce up and down at the same time but the code I have only works if I run one at a time.
local Speed = 1.5
local MoveDist = -10
local BounceDist = 1
local ActivateDist = 100
local running = false
local ts = require(game.ReplicatedStorage:WaitForChild("Modules"):WaitForChild("Tweening"):WaitForChild("TweenServicePlus"))
local tweenMove = ts:Construct(script.Parent, TweenInfo.new(Speed, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, -1, true, 0), { Position = script.Parent.Position + Vector3.new(0, 0, MoveDist)}, .4, false)
local tweenBounce = ts:Construct(script.Parent, TweenInfo.new(Speed, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, -1, true, 0), { Position = script.Parent.Position + Vector3.new(0, BounceDist, 0)}, .4, false)
while true do
for _, player in pairs(game.Players:GetPlayers()) do
local playerMag = player:DistanceFromCharacter(Vector3.new(script.Parent.Position.X, script.Parent.Position.Y, script.Parent.Position.Z))
if playerMag < ActivateDist and running == false then
running = true
tweenMove:Play()
tweenBounce:Play()
elseif playerMag < ActivateDist + 1 and running == true then
running = false
tweenMove:Pause()
tweenBounce:Play()
end
end
wait()
end