Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script.Parent = owner.Character
- Seat = Instance.new("VehicleSeat")
- Seat.Parent = script
- Seat.Size = Vector3.new(4,1,10)
- Seat.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,8,-8.057)
- Seat.TopSurface = Enum.SurfaceType.Smooth
- Seat.BottomSurface = Enum.SurfaceType.Smooth
- Bumper = Instance.new("Part")
- Bumper.Parent = script
- Bumper.Size = Vector3.new(7.75,2.25,1)
- Weldlol3 = Instance.new("Weld")
- Weldlol3.Parent = Seat
- Weldlol3.Part0 = Seat
- Weldlol3.Part1 = Bumper
- Weldlol3.C1 = Weldlol3.C1 * CFrame.new(0,-1.25,9.75)
- side = Instance.new("Part")
- side.Parent = script
- side.Size = Vector3.new(1.75,0.25,17.15)
- Weldside = Instance.new("Weld")
- Weldside.Parent = Seat
- Weldside.Part0 = Seat
- Weldside.Part1 = side
- Weldside.C1 = Weldside.C1 * CFrame.new(3.0625,-2.25,0.625)
- side2 = Instance.new("Part")
- side2.Parent = script
- side2.Size = Vector3.new(1.75,0.25,17.15)
- Weldside2 = Instance.new("Weld")
- Weldside2.Parent = Seat
- Weldside2.Part0 = Seat
- Weldside2.Part1 = side2
- Weldside2.C1 = Weldside2.C1 * CFrame.new(-3.0625,-2.25,0.625)
- Bumper3 = Instance.new("Part")
- Bumper3.Parent = script
- Bumper3.Size = Vector3.new(4,2.25,4.65)
- Weldlol32 = Instance.new("Weld")
- Weldlol32.Parent = Bumper
- Weldlol32.Part0 = Bumper
- Weldlol32.Part1 = Bumper3
- Weldlol32.C1 = Weldlol32.C1 * CFrame.new(0,0,-2.5)
- Bumper2 = Instance.new("Part")
- Bumper2.Parent = script
- Bumper2.Size = Vector3.new(7.75,2.25,1)
- Weldlol31 = Instance.new("Weld")
- Weldlol31.Parent = Seat
- Weldlol31.Part0 = Seat
- Weldlol31.Part1 = Bumper2
- Weldlol31.C1 = Weldlol31.C1 * CFrame.new(0,-1.25,-8.5)
- Bumper4 = Instance.new("Part")
- Bumper4.Parent = script
- Bumper4.Size = Vector3.new(4,2.25,4.65)
- Weldlol33 = Instance.new("Weld")
- Weldlol33.Parent = Bumper2
- Weldlol33.Part0 = Bumper2
- Weldlol33.Part1 = Bumper4
- Weldlol33.C1 = Weldlol33.C1 * CFrame.new(0,0,2.5)
- wheel = Instance.new("Part")
- wheel.Parent = Seat
- wheel.Size = Vector3.new(1,3,3)
- steer = Instance.new("Part")
- steer.Parent = Seat
- steer.Size = Vector3.new(1,1,1)
- steer2 = Instance.new("Part")
- steer2.Parent = Seat
- steer2.Size = Vector3.new(1,1,1)
- steer.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,1,-7.25)
- steer2.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,1,-7.25)
- steer.Transparency = 1
- steer.CanCollide = false
- steer2.Transparency = 1
- steer2.CanCollide = false
- wheelsus = Instance.new("Part")
- wheelsus.Parent = Seat
- wheelsus.Size = Vector3.new(1,1,1)
- wheelsus2 = Instance.new("Part")
- wheelsus2.Parent = Seat
- wheelsus2.Size = Vector3.new(1,1,1)
- wheelsus.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,1,-7.25)
- wheelsus2.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,1,-7.25)
- wheelsus.Transparency = 1
- wheelsus.CanCollide = false
- wheelsus2.Transparency = 1
- wheelsus2.CanCollide = false
- Seat.Anchored = true
- wheel.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,6.5,-7.25)
- wheel.TopSurface = Enum.SurfaceType.Smooth
- wheel.BottomSurface = Enum.SurfaceType.Smooth
- wheel2 = Instance.new("Part")
- wheel2.Parent = Seat
- wheel2.Size = Vector3.new(1,3,3)
- wheel2.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,6.5,-7.25)
- wheel2.TopSurface = Enum.SurfaceType.Smooth
- wheel2.BottomSurface = Enum.SurfaceType.Smooth
- wheel3 = Instance.new("Part")
- wheel3.Parent = Seat
- wheel3.Size = Vector3.new(1,3,3)
- wheel3.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,6.5,5.75)
- wheel3.TopSurface = Enum.SurfaceType.Smooth
- wheel3.BottomSurface = Enum.SurfaceType.Smooth
- wheel4 = Instance.new("Part")
- wheel4.Parent = Seat
- wheel4.Size = Vector3.new(1,3,3)
- wheel4.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,6.5,5.75)
- wheel4.TopSurface = Enum.SurfaceType.Smooth
- wheel4.BottomSurface = Enum.SurfaceType.Smooth
- wheel.Shape = Enum.PartType.Cylinder
- wheel2.Shape = Enum.PartType.Cylinder
- wheel3.Shape = Enum.PartType.Cylinder
- wheel4.Shape = Enum.PartType.Cylinder
- local attachment0 = Instance.new("Attachment")
- attachment0.Parent = steer
- local attachment1 = Instance.new("Attachment")
- attachment1.Parent = Seat
- alignposition = Instance.new("HingeConstraint")
- alignposition.Parent = Seat
- alignposition.ActuatorType = "Servo"
- alignposition.TargetAngle = 0
- alignposition.Name = "Hinge4"
- alignposition.ServoMaxTorque = 10000000
- alignposition.AngularSpeed = 10000000
- alignposition.Attachment0 = attachment0
- alignposition.Attachment1 = attachment1
- attachment1.WorldCFrame = attachment1.Parent.CFrame * CFrame.new(-3.739,1,-7.25) * CFrame.Angles(0,math.rad(180),math.rad(90))
- local attachment02 = Instance.new("Attachment")
- attachment02.Parent = steer2
- local attachment12 = Instance.new("Attachment")
- attachment12.Parent = Seat
- alignposition2 = Instance.new("HingeConstraint")
- alignposition2.Parent = Seat
- alignposition2.ActuatorType = "Servo"
- alignposition2.TargetAngle = 0
- alignposition2.Name = "Hinge3"
- alignposition2.ServoMaxTorque = 10000000
- alignposition2.AngularSpeed = 10000000
- alignposition2.Attachment0 = attachment02
- alignposition2.Attachment1 = attachment12
- attachment12.WorldCFrame = attachment12.Parent.CFrame * CFrame.new(3.739,1,-7.25) * CFrame.Angles(0,0,math.rad(90))
- task.wait()
- local attachment031 = Instance.new("Attachment")
- attachment031.Parent = wheel
- local attachment131 = Instance.new("Attachment")
- attachment131.Parent = wheelsus
- alignposition31 = Instance.new("HingeConstraint")
- alignposition31.Parent = Seat
- alignposition31.ActuatorType = Enum.ActuatorType.None
- alignposition31.Attachment0 = attachment031
- alignposition31.Attachment1 = attachment131
- local attachment0231 = Instance.new("Attachment")
- attachment0231.Parent = wheel2
- local attachment1231 = Instance.new("Attachment")
- attachment1231.Parent = wheelsus2
- alignposition231 = Instance.new("HingeConstraint")
- alignposition231.Parent = Seat
- alignposition231.ActuatorType = Enum.ActuatorType.None
- alignposition231.Attachment0 = attachment0231
- alignposition231.Attachment1 = attachment1231
- local attachment03 = Instance.new("Attachment")
- attachment03.Parent = wheel3
- local attachment13 = Instance.new("Attachment")
- attachment13.Parent = Seat
- alignposition3 = Instance.new("HingeConstraint")
- alignposition3.Parent = Seat
- alignposition3.ActuatorType = "Motor"
- alignposition3.MotorMaxAcceleration = 10000000
- alignposition3.MotorMaxTorque = 10000000
- alignposition3.Name = "Hinge1"
- alignposition3.Attachment0 = attachment03
- alignposition3.Attachment1 = attachment13
- attachment13.WorldCFrame = attachment13.Parent.CFrame * CFrame.new(-3.739,0,5.75)* CFrame.Angles(0,math.rad(180),0)
- local attachment023 = Instance.new("Attachment")
- attachment023.Parent = wheel4
- local attachment123 = Instance.new("Attachment")
- attachment123.Parent = Seat
- alignposition23 = Instance.new("HingeConstraint")
- alignposition23.Parent = Seat
- alignposition23.ActuatorType = "Motor"
- alignposition23.MotorMaxAcceleration = 10000000
- alignposition23.MotorMaxTorque = 10000000
- alignposition23.Name = "Hinge2"
- alignposition23.Attachment0 = attachment023
- alignposition23.Attachment1 = attachment123
- attachment123.WorldCFrame = attachment123.Parent.CFrame * CFrame.new(3.739,0,5.75)
- local motor1 = alignposition3
- local motor2 = alignposition23
- local steerServo = alignposition
- local steerServo2 = alignposition2
- local maxSpeed = 42.5
- local angleSteer = 27.5
- local function carMove(property)
- if property == "Throttle" then
- alignposition23.AngularVelocity = Seat.Throttle * maxSpeed
- alignposition3.AngularVelocity = Seat.Throttle * -maxSpeed
- elseif property == "Steer" then
- alignposition.TargetAngle = angleSteer * Seat.Steer
- alignposition2.TargetAngle = angleSteer * Seat.Steer
- end
- end
- Seat.Changed:Connect(carMove)
- local density = 1
- local friction = 1
- local elasticity = 0
- local frictionWeight = 100000000000
- local elasticityWeight = 0
- local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
- Seat.CustomPhysicalProperties = physProperties
- wheel.CustomPhysicalProperties = physProperties
- wheel2.CustomPhysicalProperties = physProperties
- wheel3.CustomPhysicalProperties = physProperties
- wheel4.CustomPhysicalProperties = physProperties
- wait(0.25)
- Seat.Anchored = false
- Mesh2 = Instance.new("SpecialMesh")
- Mesh2.Parent = wheel
- Mesh2.MeshId = "http://www.roblox.com/asset/?id=439151274"
- Mesh2.TextureId = "http://www.roblox.com/asset/?id=1110514085"
- Mesh2.Scale = Vector3.new(0.045,0.045,0.045)
- Mesh3 = Instance.new("SpecialMesh")
- Mesh3.Parent = wheel2
- Mesh3.MeshId = "http://www.roblox.com/asset/?id=439151274"
- Mesh3.TextureId = "http://www.roblox.com/asset/?id=1110514085"
- Mesh3.Scale = Vector3.new(0.045,0.045,0.045)
- Mesh4 = Instance.new("SpecialMesh")
- Mesh4.Parent = wheel3
- Mesh4.MeshId = "http://www.roblox.com/asset/?id=439151274"
- Mesh4.TextureId = "http://www.roblox.com/asset/?id=1110514085"
- Mesh4.Scale = Vector3.new(0.045,0.045,0.045)
- Mesh5 = Instance.new("SpecialMesh")
- Mesh5.Parent = wheel4
- Mesh5.MeshId = "http://www.roblox.com/asset/?id=439151274"
- Mesh5.TextureId = "http://www.roblox.com/asset/?id=1110514085"
- Mesh5.Scale = Vector3.new(0.045, 0.045, 0.045)
- local carHealth = 125
- times = 0
- function byecar()
- times = times + 1
- if times == 1 then
- leftpart = Instance.new("Part", Seat)
- leftpart.Transparency = 1
- leftpart.Anchored = true
- leftpart.CanCollide = false
- leftpart.CFrame = Seat.CFrame
- leftpart.Name = "soundpart"
- local goodbye = Instance.new("Sound", leftpart)
- goodbye.SoundId = "rbxassetid://4407929531"
- local windows = Instance.new("Sound", leftpart)
- windows.SoundId = "rbxassetid://5994223709"
- windows.Volume = 1.5
- goodbye.Volume = 1.5
- goodbye:Play()
- task.wait()
- goodbye.Ended:Wait()
- windows:Play()
- task.wait()
- for i,v in pairs(script:GetDescendants()) do
- if v:IsA("BasePart") or v:IsA("VehicleSeat") then
- local tweenService = game:GetService("TweenService")
- local timeToFade = windows.TimeLength * 0.5
- local object = v
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.Transparency = 1
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- end
- end
- task.wait()
- wait(windows.TimeLength * 0.5)
- for i,v in pairs(script:GetDescendants()) do
- if v:IsA("BasePart") or v:IsA("VehicleSeat") and v.Name ~= "soundpart" then
- v:Destroy()
- end
- end
- windows.Ended:Wait()
- goodbye:Destroy()
- windows:Destroy()
- leftpart:Destroy()
- end
- end
- Bumper.Touched:Connect(function(Hit)
- local Speed = math.floor((Bumper.Velocity - Hit.Velocity).magnitude)
- if Speed > 30 and not game.Players:GetPlayerFromCharacter(Hit.Parent) and not Hit.CanCollide == false then
- carHealth = carHealth - Bumper.Velocity.Magnitude / 1.06
- end
- if carHealth <= 10 then
- Seat.Disabled = true
- byecar()
- end
- end)
- Bumper2.Touched:Connect(function(Hit)
- local Speed = math.floor((Bumper2.Velocity - Hit.Velocity).magnitude)
- if Speed > 30 and not game.Players:GetPlayerFromCharacter(Hit.Parent) and not Hit.CanCollide == false then
- carHealth = carHealth - Bumper2.Velocity.Magnitude / 1.06
- end
- if carHealth <= 10 then
- Seat.Disabled = true
- byecar()
- end
- end)
- for i,v in pairs(script:GetDescendants()) do
- if v:IsA("BasePart") or v:IsA("VehicleSeat") then
- v.TopSurface = Enum.SurfaceType.Smooth
- v.BottomSurface = Enum.SurfaceType.Smooth
- end
- end
- E = Instance.new("RemoteEvent", owner.Character)
- E.Name = "the"
- function lightslol(plr, action)
- if plr == Seat.Occupant then
- if action == "Lights" then
- print("on")
- elseif action == "off" then
- print("off")
- end
- end
- end
- local lightsnls = NLS([[
- E = owner.Character:WaitForChild("the")
- local mouse
- script.AncestryChanged:Connect(function()
- local mouse = script.Parent.Parent:GetMouse()
- end)
- local count = 0
- mouse.KeyDown:connect(function(key)
- key = key:lower()
- if key == "l" then
- count = count + 1
- if count == 1 then
- E:FireServer("Lights")
- elseif count == 2 then
- E:FireServer("off")
- task.wait()
- count = 0
- end
- end
- end)
- task.wait()
- script.Parent = owner.PlayerGui
- ]],owner.PlayerGui)
- wait(0.1)
- lightsnls.Parent = owner.PlayerGui
- E.OnServerEvent:Connect(lightslol)
- Seat.ChildAdded:connect(function()
- local plr = game.Players:GetPlayerFromCharacter(Seat.Occupant.Parent)
- local screengui = Instance.new("ScreenGui", plr:findFirstChildOfClass("PlayerGui"))
- screengui.ResetOnSpawn = true
- screengui.Name = "youfailed"
- local tl = Instance.new("TextLabel", screengui)
- tl.Size = UDim2.new(1,0,1,0)
- tl.AnchorPoint = Vector2.new(0.5, 0.5)
- tl.Position = UDim2.new(0.5, 0, 0.5, 0)
- tl.Text = "The local script is controls for car lights"
- tl.BackgroundTransparency = 1
- tl.TextTransparency = 0
- tl.TextColor3 = Color3.new(1, 1, 1)
- tl.TextSize = 50
- lightsnls.Parent = plr.PlayerGui
- wait(2.5)
- screengui:Destroy()
- end)
- local at0 = Instance.new("Attachment" , steer)
- at0.CFrame = CFrame.Angles(0,0,math.rad(-90))
- local at1 = Instance.new("Attachment" , wheelsus)
- at1.CFrame = CFrame.Angles(0,0,math.rad(-90))
- local spring = Instance.new("SpringConstraint" , steer)
- spring.Attachment0 = at0
- spring.Attachment1 = at1
- spring.Stiffness = 700
- spring.Damping = 200
- spring.FreeLength = 8
- spring.LimitsEnabled = true
- spring.MaxForce = 10000
- spring.MaxLength = 15
- spring.MinLength = 2
- spring.Enabled = true
- spring.Visible = true
- local prism = Instance.new("PrismaticConstraint" , steer)
- prism.Attachment0 = at0
- prism.Attachment1 = at1
- local at2 = Instance.new("Attachment" , steer2)
- at2.CFrame = CFrame.Angles(0,0,math.rad(-90))
- local at3 = Instance.new("Attachment" , wheelsus2)
- at3.CFrame = CFrame.Angles(0,0,math.rad(-90))
- local spring2 = Instance.new("SpringConstraint" , steer2)
- spring2.Attachment0 = at3
- spring2.Attachment1 = at4
- spring2.Stiffness = 700
- spring2.Damping = 200
- spring2.FreeLength = 8
- spring2.LimitsEnabled = true
- spring2.MaxForce = 10000
- spring2.MaxLength = 15
- spring2.MinLength = 2
- spring2.Enabled = true
- spring2.Visible = true
- local prism2 = Instance.new("PrismaticConstraint" , steer2)
- prism2.Attachment0 = at3
- prism2.Attachment1 = at4
- at4.WorldCFrame = at4.Parent.CFrame * CFrame.new(-1,0,0) * CFrame.Angles(0,0,math.rad(-90))
- at3.WorldCFrame = at3.Parent.CFrame * CFrame.new(-1,0,0) * CFrame.Angles(0,0,math.rad(-90))
- at1.WorldCFrame = at1.Parent.CFrame * CFrame.new(-1,0,0) * CFrame.Angles(0,0,math.rad(-90))
- at2.WorldCFrame = at2.Parent.CFrame * CFrame.new(-1,0,0) * CFrame.Angles(0,0,math.rad(-90))
Add Comment
Please, Sign In to add comment