Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rotated = false
- spawn(function()
- while wait(0.00000000001) do
- for i,x in pairs(script.Parent:GetChildren()) do
- if x.Name == "Seat" then
- if x:FindFirstChild("SeatWeld") then
- local humanoid = x.Occupant
- humanoid.Parent:SetPrimaryPartCFrame(x.CFrame+Vector3.new(0,2,0))
- end
- end
- end
- end
- end)
- while wait(0.5) do
- local part = script.Parent.Main
- local ray = Ray.new(part.CFrame.p, CFrame.new(0,part.CFrame.Y-500,0).p)
- local hitpart, position = workspace:FindPartOnRay(ray, script.Parent.Parent)
- if hitpart then
- local tweenService = game:GetService("TweenService")
- local CFrameValue = Instance.new("CFrameValue")
- local info = TweenInfo.new(0.5)
- CFrameValue.Value = script.Parent:GetPrimaryPartCFrame()
- CFrameValue:GetPropertyChangedSignal("Value"):connect(function()
- script.Parent:SetPrimaryPartCFrame(CFrameValue.Value)
- end)
- local cframe = CFrame.new(position.x,position.y+4,position.z)
- if rotated == true then
- cframe = cframe * CFrame.Angles(0,0,150.5)
- rotated = false
- else
- cframe = cframe * CFrame.Angles(0,0,145)
- rotated = true
- end
- local tween = tweenService:Create(CFrameValue, info, {Value = cframe})
- tween:Play()
- local able = false
- tween.Completed:connect(function()
- CFrameValue:Destroy()
- able = true
- end)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement