Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- carmodel = Instance.new("Model", script)
- carmodel.Name = "Trucc"
- Seat = Instance.new("VehicleSeat")
- Seat.Parent = carmodel
- 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
- carmodel.PrimaryPart = Seat
- Bumper = Instance.new("Part")
- Bumper.Parent = carmodel
- 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.65)
- Bumper3 = Instance.new("Part")
- Bumper3.Parent = carmodel
- 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)
- Seatlol = Instance.new("Seat")
- Seatlol.Parent = carmodel
- Seatlol.Size = Vector3.new(7,1,2)
- seatweld = Instance.new("Weld")
- seatweld.Parent = Seat
- seatweld.Part0 = Seat
- seatweld.Part1 = Seatlol
- seatweld.C1 = seatweld.C1 * CFrame.new(0,-0.75,1.75) * CFrame.Angles(0,math.rad(180),0)
- Bumper2 = Instance.new("Part")
- Bumper2.Parent = carmodel
- 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,-10.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
- 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
- Mesh = Instance.new("SpecialMesh")
- Mesh.Parent = Seat
- Mesh.MeshId = "http://www.roblox.com/asset/?id=7408695235"
- Mesh.TextureId = "http://www.roblox.com/asset/?id=7408695426"
- Mesh.Scale = Vector3.new(5, 5, 5)
- Mesh.Offset = Vector3.new(0, 2.75, 0.45)
- Bumper.Transparency = 1
- Bumper2.Transparency = 1
- Bumper3.Transparency = 1
- 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 = 100000000000
- alignposition.AngularSpeed = 100000000000
- alignposition.Attachment0 = attachment0
- alignposition.Attachment1 = attachment1
- attachment1.WorldCFrame = attachment1.Parent.CFrame * CFrame.new(-3.739,1,-7) * 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 = 100000000000
- alignposition2.AngularSpeed = 100000000000
- alignposition2.Attachment0 = attachment02
- alignposition2.Attachment1 = attachment12
- attachment12.WorldCFrame = attachment12.Parent.CFrame * CFrame.new(3.739,1,-7) * CFrame.Angles(0,0,math.rad(90))
- task.wait()
- local attachment031 = Instance.new("Attachment")
- attachment031.Parent = wheel
- local attachment131 = Instance.new("Attachment")
- attachment131.Parent = steer
- alignposition31 = Instance.new("HingeConstraint")
- alignposition31.Parent = Seat
- alignposition31.ActuatorType = Enum.ActuatorType.None
- alignposition31.Attachment0 = attachment031
- alignposition31.Attachment1 = attachment131
- attachment131.WorldCFrame = attachment131.Parent.CFrame * CFrame.new(-1.5,0,0) * CFrame.Angles(0,0,math.rad(-90))
- local attachment0231 = Instance.new("Attachment")
- attachment0231.Parent = wheel2
- local attachment1231 = Instance.new("Attachment")
- attachment1231.Parent = steer2
- alignposition231 = Instance.new("HingeConstraint")
- alignposition231.Parent = Seat
- alignposition231.ActuatorType = Enum.ActuatorType.None
- alignposition231.Attachment0 = attachment0231
- alignposition231.Attachment1 = attachment1231
- attachment1231.WorldCFrame = attachment1231.Parent.CFrame * CFrame.new(-1.5,0,0) * CFrame.Angles(0,0,math.rad(-90))
- 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 = 100000000000
- alignposition3.MotorMaxTorque = 100000000000
- alignposition3.Name = "Hinge1"
- alignposition3.Attachment0 = attachment03
- alignposition3.Attachment1 = attachment13
- attachment13.WorldCFrame = attachment13.Parent.CFrame * CFrame.new(-3.739,-0.5,6.45)* 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 = 100000000000
- alignposition23.MotorMaxTorque = 100000000000
- alignposition23.Name = "Hinge2"
- alignposition23.Attachment0 = attachment023
- alignposition23.Attachment1 = attachment123
- attachment123.WorldCFrame = attachment123.Parent.CFrame * CFrame.new(3.739,-0.5,6.45)
- local motor1 = alignposition3
- local motor2 = alignposition23
- local steerServo = alignposition
- local steerServo2 = alignposition2
- local maxSpeed = 57.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)
Add Comment
Please, Sign In to add comment