SHOW:
|
|
- or go back to the newest paste.
1 | local debris = game:GetService("Debris") | |
2 | Bullet = Instance.new("Part", owner.Character) | |
3 | Bullet.Position = Vector3.new(1000000,1000000,1000000) | |
4 | Bullet.Anchored = true | |
5 | Bullet.CanCollide = false | |
6 | script.Parent = owner.Character | |
7 | Seat = Instance.new("VehicleSeat") | |
8 | Seat.Parent = script | |
9 | Seat.Size = Vector3.new(4,1,10) | |
10 | Seat.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,8,-8.057) | |
11 | Seat.TopSurface = Enum.SurfaceType.Smooth | |
12 | Seat.BottomSurface = Enum.SurfaceType.Smooth | |
13 | Bumper = Instance.new("Part") | |
14 | Bumper.Parent = script | |
15 | Bumper.Size = Vector3.new(7.75,2.25,1) | |
16 | Weldlol3 = Instance.new("Weld") | |
17 | Weldlol3.Parent = Seat | |
18 | Weldlol3.Part0 = Seat | |
19 | Weldlol3.Part1 = Bumper | |
20 | Weldlol3.C1 = Weldlol3.C1 * CFrame.new(0,-1.25,9.75) | |
21 | side = Instance.new("Part") | |
22 | side.Parent = script | |
23 | side.Size = Vector3.new(1.75,0.25,17.15) | |
24 | Weldside = Instance.new("Weld") | |
25 | Weldside.Parent = Seat | |
26 | Weldside.Part0 = Seat | |
27 | Weldside.Part1 = side | |
28 | Weldside.C1 = Weldside.C1 * CFrame.new(3.0625,-2.25,0.625) | |
29 | side2 = Instance.new("Part") | |
30 | side2.Parent = script | |
31 | side2.Size = Vector3.new(1.75,0.25,17.15) | |
32 | Weldside2 = Instance.new("Weld") | |
33 | Weldside2.Parent = Seat | |
34 | Weldside2.Part0 = Seat | |
35 | Weldside2.Part1 = side2 | |
36 | Weldside2.C1 = Weldside2.C1 * CFrame.new(-3.0625,-2.25,0.625) | |
37 | Bumper3 = Instance.new("Part") | |
38 | Bumper3.Parent = script | |
39 | Bumper3.Size = Vector3.new(4,2.25,4.65) | |
40 | Weldlol32 = Instance.new("Weld") | |
41 | Weldlol32.Parent = Bumper | |
42 | Weldlol32.Part0 = Bumper | |
43 | Weldlol32.Part1 = Bumper3 | |
44 | Weldlol32.C1 = Weldlol32.C1 * CFrame.new(0,0,-2.5) | |
45 | Bumper2 = Instance.new("Part") | |
46 | Bumper2.Parent = script | |
47 | Bumper2.Size = Vector3.new(7.75,2.25,1) | |
48 | Weldlol31 = Instance.new("Weld") | |
49 | Weldlol31.Parent = Seat | |
50 | Weldlol31.Part0 = Seat | |
51 | Weldlol31.Part1 = Bumper2 | |
52 | Weldlol31.C1 = Weldlol31.C1 * CFrame.new(0,-1.25,-8.5) | |
53 | Bumper4 = Instance.new("Part") | |
54 | Bumper4.Parent = script | |
55 | Bumper4.Size = Vector3.new(4,2.25,4.65) | |
56 | Weldlol33 = Instance.new("Weld") | |
57 | Weldlol33.Parent = Bumper2 | |
58 | Weldlol33.Part0 = Bumper2 | |
59 | Weldlol33.Part1 = Bumper4 | |
60 | Weldlol33.C1 = Weldlol33.C1 * CFrame.new(0,0,2.5) | |
61 | wheel = Instance.new("Part") | |
62 | wheel.Parent = Seat | |
63 | wheel.Size = Vector3.new(1,3,3) | |
64 | steer = Instance.new("Part") | |
65 | steer.Parent = Seat | |
66 | steer.Size = Vector3.new(1,1,1) | |
67 | steer2 = Instance.new("Part") | |
68 | steer2.Parent = Seat | |
69 | steer2.Size = Vector3.new(1,1,1) | |
70 | steer.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,1,-7.25) | |
71 | - | wheelsus = Instance.new("Part") |
71 | + | |
72 | - | wheelsus.Parent = Seat |
72 | + | |
73 | - | wheelsus.Size = Vector3.new(1,1,1) |
73 | + | |
74 | - | wheelsus2 = Instance.new("Part") |
74 | + | |
75 | - | wheelsus2.Parent = Seat |
75 | + | |
76 | - | wheelsus2.Size = Vector3.new(1,1,1) |
76 | + | |
77 | - | wheelsus.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,1,-7.25) |
77 | + | |
78 | - | wheelsus2.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,1,-7.25) |
78 | + | |
79 | - | wheelsus.Transparency = 1 |
79 | + | |
80 | - | wheelsus.CanCollide = false |
80 | + | |
81 | - | wheelsus2.Transparency = 1 |
81 | + | |
82 | - | wheelsus2.CanCollide = false |
82 | + | |
83 | wheel2.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,6.5,-7.25) | |
84 | wheel2.TopSurface = Enum.SurfaceType.Smooth | |
85 | wheel2.BottomSurface = Enum.SurfaceType.Smooth | |
86 | wheel3 = Instance.new("Part") | |
87 | wheel3.Parent = Seat | |
88 | wheel3.Size = Vector3.new(1,3,3) | |
89 | wheel3.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-3.739,6.5,5.75) | |
90 | wheel3.TopSurface = Enum.SurfaceType.Smooth | |
91 | wheel3.BottomSurface = Enum.SurfaceType.Smooth | |
92 | wheel4 = Instance.new("Part") | |
93 | wheel4.Parent = Seat | |
94 | wheel4.Size = Vector3.new(1,3,3) | |
95 | wheel4.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(3.739,6.5,5.75) | |
96 | wheel4.TopSurface = Enum.SurfaceType.Smooth | |
97 | wheel4.BottomSurface = Enum.SurfaceType.Smooth | |
98 | wheel.Shape = Enum.PartType.Cylinder | |
99 | wheel2.Shape = Enum.PartType.Cylinder | |
100 | wheel3.Shape = Enum.PartType.Cylinder | |
101 | wheel4.Shape = Enum.PartType.Cylinder | |
102 | local attachment0 = Instance.new("Attachment") | |
103 | attachment0.Parent = steer | |
104 | local attachment1 = Instance.new("Attachment") | |
105 | attachment1.Parent = Seat | |
106 | alignposition = Instance.new("HingeConstraint") | |
107 | alignposition.Parent = Seat | |
108 | alignposition.ActuatorType = "Servo" | |
109 | alignposition.TargetAngle = 0 | |
110 | alignposition.Name = "Hinge4" | |
111 | alignposition.ServoMaxTorque = 10000000 | |
112 | alignposition.AngularSpeed = 10000000 | |
113 | alignposition.Attachment0 = attachment0 | |
114 | alignposition.Attachment1 = attachment1 | |
115 | attachment1.WorldCFrame = attachment1.Parent.CFrame * CFrame.new(-3.739,1,-7.25) * CFrame.Angles(0,math.rad(180),math.rad(90)) | |
116 | local attachment02 = Instance.new("Attachment") | |
117 | attachment02.Parent = steer2 | |
118 | local attachment12 = Instance.new("Attachment") | |
119 | attachment12.Parent = Seat | |
120 | alignposition2 = Instance.new("HingeConstraint") | |
121 | alignposition2.Parent = Seat | |
122 | alignposition2.ActuatorType = "Servo" | |
123 | alignposition2.TargetAngle = 0 | |
124 | alignposition2.Name = "Hinge3" | |
125 | alignposition2.ServoMaxTorque = 10000000 | |
126 | alignposition2.AngularSpeed = 10000000 | |
127 | alignposition2.Attachment0 = attachment02 | |
128 | alignposition2.Attachment1 = attachment12 | |
129 | attachment12.WorldCFrame = attachment12.Parent.CFrame * CFrame.new(3.739,1,-7.25) * CFrame.Angles(0,0,math.rad(90)) | |
130 | task.wait() | |
131 | local attachment031 = Instance.new("Attachment") | |
132 | attachment031.Parent = wheel | |
133 | local attachment131 = Instance.new("Attachment") | |
134 | attachment131.Parent = steer | |
135 | alignposition31 = Instance.new("HingeConstraint") | |
136 | alignposition31.Parent = Seat | |
137 | alignposition31.ActuatorType = Enum.ActuatorType.None | |
138 | alignposition31.Attachment0 = attachment031 | |
139 | alignposition31.Attachment1 = attachment131 | |
140 | attachment131.WorldCFrame = attachment131.Parent.CFrame * CFrame.new(-1,0,0) * CFrame.Angles(0,0,math.rad(-90)) | |
141 | - | attachment131.Parent = wheelsus |
141 | + | |
142 | attachment0231.Parent = wheel2 | |
143 | local attachment1231 = Instance.new("Attachment") | |
144 | attachment1231.Parent = steer2 | |
145 | alignposition231 = Instance.new("HingeConstraint") | |
146 | alignposition231.Parent = Seat | |
147 | alignposition231.ActuatorType = Enum.ActuatorType.None | |
148 | alignposition231.Attachment0 = attachment0231 | |
149 | alignposition231.Attachment1 = attachment1231 | |
150 | - | attachment1231.Parent = wheelsus2 |
150 | + | attachment1231.WorldCFrame = attachment1231.Parent.CFrame * CFrame.new(-1,0,0) * CFrame.Angles(0,0,math.rad(-90)) |
151 | local attachment03 = Instance.new("Attachment") | |
152 | attachment03.Parent = wheel3 | |
153 | local attachment13 = Instance.new("Attachment") | |
154 | attachment13.Parent = Seat | |
155 | alignposition3 = Instance.new("HingeConstraint") | |
156 | alignposition3.Parent = Seat | |
157 | alignposition3.ActuatorType = "Motor" | |
158 | alignposition3.MotorMaxAcceleration = 10000000 | |
159 | alignposition3.MotorMaxTorque = 10000000 | |
160 | alignposition3.Name = "Hinge1" | |
161 | alignposition3.Attachment0 = attachment03 | |
162 | alignposition3.Attachment1 = attachment13 | |
163 | attachment13.WorldCFrame = attachment13.Parent.CFrame * CFrame.new(-3.739,0,5.75)* CFrame.Angles(0,math.rad(180),0) | |
164 | local attachment023 = Instance.new("Attachment") | |
165 | attachment023.Parent = wheel4 | |
166 | local attachment123 = Instance.new("Attachment") | |
167 | attachment123.Parent = Seat | |
168 | alignposition23 = Instance.new("HingeConstraint") | |
169 | alignposition23.Parent = Seat | |
170 | alignposition23.ActuatorType = "Motor" | |
171 | alignposition23.MotorMaxAcceleration = 10000000 | |
172 | alignposition23.MotorMaxTorque = 10000000 | |
173 | alignposition23.Name = "Hinge2" | |
174 | alignposition23.Attachment0 = attachment023 | |
175 | alignposition23.Attachment1 = attachment123 | |
176 | attachment123.WorldCFrame = attachment123.Parent.CFrame * CFrame.new(3.739,0,5.75) | |
177 | local motor1 = alignposition3 | |
178 | local motor2 = alignposition23 | |
179 | local steerServo = alignposition | |
180 | local steerServo2 = alignposition2 | |
181 | local maxSpeed = 20 | |
182 | local angleSteer = 27.5 | |
183 | local density = 1 | |
184 | local friction = 1 | |
185 | local elasticity = 0 | |
186 | - | local maxSpeed = 42.5 |
186 | + | |
187 | local elasticityWeight = 0 | |
188 | local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight) | |
189 | Seat.CustomPhysicalProperties = physProperties | |
190 | wheel.CustomPhysicalProperties = physProperties | |
191 | wheel2.CustomPhysicalProperties = physProperties | |
192 | wheel3.CustomPhysicalProperties = physProperties | |
193 | wheel4.CustomPhysicalProperties = physProperties | |
194 | wait(0.25) | |
195 | Seat.Anchored = false | |
196 | local override = false | |
197 | local active = false | |
198 | local stopped = true | |
199 | owner.Chatted:Connect(function(message) | |
200 | if message == "!Go" then | |
201 | active = true | |
202 | stopped = false | |
203 | elseif message == "!Stop" then | |
204 | active = false | |
205 | stopped = true | |
206 | alignposition23.AngularVelocity = 0 | |
207 | alignposition3.AngularVelocity = 0 | |
208 | end | |
209 | end) | |
210 | local maxSpeed = 20 | |
211 | - | Mesh2 = Instance.new("SpecialMesh") |
211 | + | |
212 | - | Mesh2.Parent = wheel |
212 | + | |
213 | - | Mesh2.MeshId = "http://www.roblox.com/asset/?id=439151274" |
213 | + | if not active then |
214 | - | Mesh2.TextureId = "http://www.roblox.com/asset/?id=1110514085" |
214 | + | |
215 | - | Mesh2.Scale = Vector3.new(0.045,0.045,0.045) |
215 | + | |
216 | - | Mesh3 = Instance.new("SpecialMesh") |
216 | + | |
217 | - | Mesh3.Parent = wheel2 |
217 | + | |
218 | - | Mesh3.MeshId = "http://www.roblox.com/asset/?id=439151274" |
218 | + | |
219 | - | Mesh3.TextureId = "http://www.roblox.com/asset/?id=1110514085" |
219 | + | |
220 | - | Mesh3.Scale = Vector3.new(0.045,0.045,0.045) |
220 | + | |
221 | - | Mesh4 = Instance.new("SpecialMesh") |
221 | + | |
222 | - | Mesh4.Parent = wheel3 |
222 | + | |
223 | - | Mesh4.MeshId = "http://www.roblox.com/asset/?id=439151274" |
223 | + | |
224 | - | Mesh4.TextureId = "http://www.roblox.com/asset/?id=1110514085" |
224 | + | local bp = Instance.new("BodyPosition",Seat) |
225 | - | Mesh4.Scale = Vector3.new(0.045,0.045,0.045) |
225 | + | bp.D = 100 |
226 | - | Mesh5 = Instance.new("SpecialMesh") |
226 | + | bp.P = 0 |
227 | - | Mesh5.Parent = wheel4 |
227 | + | while true do |
228 | - | Mesh5.MeshId = "http://www.roblox.com/asset/?id=439151274" |
228 | + | |
229 | - | Mesh5.TextureId = "http://www.roblox.com/asset/?id=1110514085" |
229 | + | while active do |
230 | - | Mesh5.Scale = Vector3.new(0.045, 0.045, 0.045) |
230 | + | |
231 | - | local carHealth = 125 |
231 | + | if not stopped then |
232 | - | times = 0 |
232 | + | local origin = Bumper.Position |
233 | - | function byecar() |
233 | + | local pos = Bumper.Position * Vector3.new(0,-5,4) |
234 | - | times = times + 1 |
234 | + | local direction = (pos - origin).Unit*10 |
235 | - | if times == 1 then |
235 | + | local result = game.Workspace:Raycast(origin, direction) |
236 | - | leftpart = Instance.new("Part", Seat) |
236 | + | local origin3 = Bumper.Position * Vector3.new(-1,0,0) |
237 | - | leftpart.Transparency = 1 |
237 | + | local pos3 = Bumper.Position * Vector3.new(-1.25,-5,3.5) |
238 | - | leftpart.Anchored = true |
238 | + | local direction3 = (pos3 - origin3).Unit*10 |
239 | - | leftpart.CanCollide = false |
239 | + | local result3 = game.Workspace:Raycast(origin3, direction3) |
240 | - | leftpart.CFrame = Seat.CFrame |
240 | + | local origin4 = Bumper.Position * Vector3.new(1,0,0) |
241 | - | leftpart.Name = "soundpart" |
241 | + | local pos4 = Bumper.Position * Vector3.new(1.25,-5,3.5) |
242 | - | local goodbye = Instance.new("Sound", leftpart) |
242 | + | local direction4 = (pos4 - origin4).Unit*10 |
243 | - | goodbye.SoundId = "rbxassetid://4407929531" |
243 | + | local result4 = game.Workspace:Raycast(origin4, direction4) |
244 | - | local windows = Instance.new("Sound", leftpart) |
244 | + | if result == nil and result3 == nil and result4 == nil then |
245 | - | windows.SoundId = "rbxassetid://5994223709" |
245 | + | active = false |
246 | - | windows.Volume = 1.5 |
246 | + | bp.P = 10000 |
247 | - | goodbye.Volume = 1.5 |
247 | + | bp.position = Seat.Position |
248 | - | goodbye:Play() |
248 | + | wait(0.75) |
249 | bp.P = 0 | |
250 | - | goodbye.Ended:Wait() |
250 | + | alignposition23.AngularVelocity = -1 * maxSpeed |
251 | - | windows:Play() |
251 | + | alignposition3.AngularVelocity = -1 * -maxSpeed |
252 | alignposition.TargetAngle = angleSteer * 1 | |
253 | - | for i,v in pairs(script:GetDescendants()) do |
253 | + | alignposition2.TargetAngle = angleSteer * 1 |
254 | - | if v:IsA("BasePart") or v:IsA("VehicleSeat") then |
254 | + | override = true |
255 | - | local tweenService = game:GetService("TweenService") |
255 | + | |
256 | - | |
256 | + | alignposition23.AngularVelocity = 1 * maxSpeed |
257 | - | local timeToFade = windows.TimeLength * 0.5 |
257 | + | alignposition3.AngularVelocity = 1 * -maxSpeed |
258 | - | local object = v |
258 | + | alignposition.TargetAngle = angleSteer * -1 |
259 | - | local tweenInfo = TweenInfo.new(timeToFade) |
259 | + | alignposition2.TargetAngle = angleSteer * -1 |
260 | - | local goal = {} |
260 | + | |
261 | - | goal.Transparency = 1 |
261 | + | alignposition23.AngularVelocity = 0 * maxSpeed |
262 | - | |
262 | + | alignposition3.AngularVelocity = 0 * -maxSpeed |
263 | - | local tween = tweenService:Create(object, tweenInfo, goal) |
263 | + | alignposition.TargetAngle = angleSteer * 0 |
264 | - | tween:Play() |
264 | + | alignposition2.TargetAngle = angleSteer * 0 |
265 | active = true | |
266 | override = false | |
267 | elseif result4 == nil then | |
268 | - | wait(windows.TimeLength * 0.5) |
268 | + | alignposition.TargetAngle = angleSteer * 1 |
269 | - | for i,v in pairs(script:GetDescendants()) do |
269 | + | alignposition2.TargetAngle = angleSteer * 1 |
270 | - | if v:IsA("BasePart") or v:IsA("VehicleSeat") and v.Name ~= "soundpart" then |
270 | + | alignposition23.AngularVelocity = 1 * maxSpeed |
271 | - | v:Destroy() |
271 | + | alignposition3.AngularVelocity = 1 * -maxSpeed |
272 | active = false | |
273 | override = true | |
274 | - | windows.Ended:Wait() |
274 | + | wait(1.5) |
275 | - | goodbye:Destroy() |
275 | + | alignposition.TargetAngle = angleSteer * 0 |
276 | - | windows:Destroy() |
276 | + | alignposition2.TargetAngle = angleSteer * 0 |
277 | - | leftpart:Destroy() |
277 | + | alignposition23.AngularVelocity = 0 * maxSpeed |
278 | alignposition3.AngularVelocity = 0 * -maxSpeed | |
279 | active = true | |
280 | - | Bumper.Touched:Connect(function(Hit) |
280 | + | override = false |
281 | - | |
281 | + | elseif result == nil then |
282 | - | local Speed = math.floor((Bumper.Velocity - Hit.Velocity).magnitude) |
282 | + | alignposition.TargetAngle = angleSteer * 1 |
283 | - | |
283 | + | alignposition2.TargetAngle = angleSteer * 1 |
284 | - | if Speed > 30 and not game.Players:GetPlayerFromCharacter(Hit.Parent) and not Hit.CanCollide == false then |
284 | + | alignposition23.AngularVelocity = 1 * maxSpeed |
285 | - | |
285 | + | alignposition3.AngularVelocity = 1 * -maxSpeed |
286 | - | carHealth = carHealth - Bumper.Velocity.Magnitude / 1.06 |
286 | + | active = false |
287 | - | |
287 | + | override = true |
288 | wait(1.5) | |
289 | - | |
289 | + | alignposition.TargetAngle = angleSteer * 0 |
290 | - | if carHealth <= 10 then |
290 | + | alignposition2.TargetAngle = angleSteer * 0 |
291 | - | Seat.Disabled = true |
291 | + | alignposition23.AngularVelocity = 0 * maxSpeed |
292 | - | byecar() |
292 | + | alignposition3.AngularVelocity = 0 * -maxSpeed |
293 | active = true | |
294 | override = false | |
295 | - | |
295 | + | elseif result3 == nil then |
296 | - | Bumper2.Touched:Connect(function(Hit) |
296 | + | alignposition.TargetAngle = angleSteer * -1 |
297 | - | |
297 | + | alignposition2.TargetAngle = angleSteer * -1 |
298 | - | local Speed = math.floor((Bumper2.Velocity - Hit.Velocity).magnitude) |
298 | + | alignposition23.AngularVelocity = 1 * maxSpeed |
299 | - | |
299 | + | alignposition3.AngularVelocity = 1 * -maxSpeed |
300 | - | if Speed > 30 and not game.Players:GetPlayerFromCharacter(Hit.Parent) and not Hit.CanCollide == false then |
300 | + | override = true |
301 | - | |
301 | + | active = false |
302 | - | carHealth = carHealth - Bumper2.Velocity.Magnitude / 1.06 |
302 | + | wait(1.5) |
303 | - | |
303 | + | alignposition.TargetAngle = angleSteer * 0 |
304 | alignposition2.TargetAngle = angleSteer * 0 | |
305 | - | if carHealth <= 10 then |
305 | + | alignposition23.AngularVelocity = 0 * maxSpeed |
306 | - | Seat.Disabled = true |
306 | + | alignposition3.AngularVelocity = 0 * -maxSpeed |
307 | - | byecar() |
307 | + | active = true |
308 | override = false | |
309 | end | |
310 | - | for i,v in pairs(script:GetDescendants()) do |
310 | + | else |
311 | - | if v:IsA("BasePart") or v:IsA("VehicleSeat") then |
311 | + | |
312 | - | v.TopSurface = Enum.SurfaceType.Smooth |
312 | + | random1 = math.random(-1, 2) |
313 | - | v.BottomSurface = Enum.SurfaceType.Smooth |
313 | + | random2 = math.random(0.1, 2) |
314 | random3 = math.random(0.1, 2) | |
315 | alignposition23.AngularVelocity = 1 * maxSpeed | |
316 | - | E = Instance.new("RemoteEvent", owner.Character) |
316 | + | alignposition3.AngularVelocity = 1 * -maxSpeed |
317 | - | E.Name = "the" |
317 | + | alignposition.TargetAngle = angleSteer * random1 |
318 | - | function lightslol(plr, action) |
318 | + | alignposition2.TargetAngle = angleSteer * random1 |
319 | - | if plr == Seat.Occupant then |
319 | + | wait(random2) |
320 | - | if action == "Lights" then |
320 | + | alignposition23.AngularVelocity = 1 * maxSpeed |
321 | - | print("on") |
321 | + | alignposition3.AngularVelocity = 1 * -maxSpeed |
322 | - | elseif action == "off" then |
322 | + | alignposition.TargetAngle = 0 |
323 | - | print("off") |
323 | + | alignposition2.TargetAngle = 0 |
324 | wait(random3) | |
325 | end | |
326 | end |