local Service = game:GetService("TweenService")
part1 = workspace:WaitForChild("veyron").Body.spoilermech1.part01
part1posx = part1.CFrame.Position.X
part1posy = part1.CFrame.Position.Y
part1posz = part1.CFrame.Position.Z
part2 = workspace:WaitForChild("veyron").Body.spoilermech1.part0
part2posx = part2.CFrame.Position.X
part2posy = part2.CFrame.Position.Y
part2posz = part2.CFrame.Position.Z
part3 = workspace:WaitForChild("veyron").Body.spoilermech1.part1
part3posx = part3.CFrame.Position.X
part3posy = part3.CFrame.Position.Y
part3posz = part3.CFrame.Position.Z
part4 = workspace:WaitForChild("veyron").Body.spoilermech1.part2
part4posx = part4.CFrame.Position.X
part4posy = part4.CFrame.Position.Y
part4posz = part4.CFrame.Position.Z
part5 = workspace:WaitForChild("veyron").Body.spoilermech1.part3
part5posx = part5.CFrame.Position.X
part5posy = part5.CFrame.Position.Y
part5posz = part5.CFrame.Position.Z
part6 = workspace:WaitForChild("veyron").Body.spoilermech1.part4
part6posx = part6.CFrame.Position.X
part6posy = part6.CFrame.Position.Y
part6posz = part6.CFrame.Position.Z
part7 = workspace:WaitForChild("veyron").Body.spoilermech1.part5
part7posx = part7.CFrame.Position.X
part7posy = part7.CFrame.Position.Y
part7posz = part7.CFrame.Position.Z
-- CFrame/Part Variables
-- Spoiler Variables
local goal1 = {}
goal1.Orientation = Vector3.new(0, 0, 0)
goal1.Position = Vector3.new(part1posx - 0.834, part1posy + 1.092, part1posz)
local tweenInfo1 = TweenInfo.new(0.7,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,1,true,0)
local Tween1 = Service:Create(part1,tweenInfo1,goal1)
local goal2 = {}
goal2.Orientation = Vector3.new(0,0,0)
goal2.Position = Vector3.new(part2posx - 0.725, part2posy + 1.248, part2posz)
local tweenInfo2 = TweenInfo.new(0.7,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,1,true,0)
local Tween2 = Service:Create(part2,tweenInfo2,goal2)
local goal3 = {}
goal3.Orientation = Vector3.new(0,0,0)
goal3.Position = Vector3.new(part3posx - 1.042, part3posy + 0.736, part3posz)
local tweenInfo3 = TweenInfo.new(0.7,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,1,true,0)
local Tween3 = Service:Create(part3,tweenInfo2,goal3)
local goal4 = {}
goal4.Orientation = Vector3.new(0,0,0)
goal4.Position = Vector3.new(part4posx - 0.791, part4posy + 1, part4posz)
local tweenInfo4 = TweenInfo.new(0.7,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,1,true,0)
local Tween4 = Service:Create(part4,tweenInfo4,goal4)
local goal5 = {}
goal5.Orientation = Vector3.new(0,0,0)
goal5.Position = Vector3.new(part5posx - 0.952, part5posy + 1.109, part5posz)
local tweenInfo5 = TweenInfo.new(0.7,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,1,true,0)
local Tween5 = Service:Create(part5,tweenInfo5,goal5)
local goal6 = {}
goal6.Orientation = Vector3.new(0,0,0)
goal6.Position = Vector3.new(part6posx - 0.917, part6posy + 1.01, part6posz)
local tweenInfo6 = TweenInfo.new(0.7,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,1,true,0)
local Tween6 = Service:Create(part6,tweenInfo6,goal6)
local goal7 = {}
goal7.Orientation = Vector3.new(0,0,0)
goal7.Position = Vector3.new(part7posx - 0.718, part7posy + 1.231, part7posz)
local tweenInfo7 = TweenInfo.new(0.7,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,1,true,0)
local Tween7 = Service:Create(part7,tweenInfo7,goal7)
-- Spoiler Variables
local seat = game.Workspace.veyron.DriveSeat
local value = game.Players.LocalPlayer.PlayerGui:WaitForChild("A-Chassis Interface").Values
-- Spoiler Movement Pieces
repeat wait()
if value.Velocity.Value.Magnitude >220 then
Tween1:Play()
Tween2:Play()
Tween3:Play()
Tween4:Play()
Tween5:Play()
Tween6:Play()
Tween7:Play()
wait(0.7)
Tween1:Pause()
Tween2:Pause()
Tween3:Pause()
Tween4:Pause()
Tween5:Pause()
Tween6:Pause()
Tween7:Pause()
end
until value.Velocity.Value.Magnitude >220
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
local humanoid = seat.Occupant
if not humanoid or value.Velocity.Value.Magnitude <220 then
Tween1:Play()
Tween2:Play()
Tween3:Play()
Tween4:Play()
Tween5:Play()
Tween6:Play()
Tween7:Play()
wait(0.72)
Tween1:Pause()
Tween2:Pause()
Tween3:Pause()
Tween4:Pause()
Tween5:Pause()
Tween6:Pause()
Tween7:Pause()
end
end)
Hello, I am currently trying to make a car's spoiler move up when it reaches a certain speed. I have that part down, but I'm having issues with it, when parts are tweened, they are teleported to where they first were when I loaded in, then they are tweened. I have found no solution to this.
Thank you!
