Advertisement
Blueisim

j33pscript

Aug 15th, 2016
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.67 KB | None | 0 0
  1. -- Created with Z_Vs M2S Plugin UnionOperation,ModuleScript
  2. Create = function(itemClass,tabl)
  3. local item = Instance.new(itemClass)
  4. for i,v in pairs(tabl) do
  5. local a,b = ypcall(function() return item[i] end)
  6. if a then
  7. item[i] = tabl[i]
  8. end
  9. end
  10. return item
  11. end
  12. function runDummyScript(f,scri)
  13. local oldenv = getfenv(f)
  14. local newenv = setmetatable({}, {
  15. __index = function(_, k)
  16. if k:lower() == 'script' then
  17. return scri
  18. else
  19. return oldenv[k]
  20. end
  21. end
  22. })
  23. setfenv(f, newenv)
  24. ypcall(function() f() end)
  25. end
  26. cors = {}
  27. mas = Instance.new("Model",game:GetService("Lighting"))
  28. mas.Name = "CompiledModel"
  29. o1 = Create("Model",{
  30. ["Name"] = "Jeep1",
  31. ["Parent"] = mas,
  32. })
  33. o2 = Create("Part",{
  34. ["Name"] = "Thruster",
  35. ["Parent"] = o1,
  36. ["Transparency"] = 1,
  37. ["Position"] = Vector3.new(-15.25, 2.50999975, 66.25),
  38. ["Rotation"] = Vector3.new(0, 90, 0),
  39. ["CFrame"] = CFrame.new(-15.25, 2.50999975, 66.25, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  40. ["CanCollide"] = false,
  41. ["FormFactor"] = Enum.FormFactor.Custom,
  42. ["Size"] = Vector3.new(1, 1, 2),
  43. ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  44. ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  45. ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  46. ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  47. ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  48. ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  49. })
  50. o3 = Create("Weld",{
  51. ["Parent"] = o2,
  52. ["Part0"] = o17,
  53. ["Part1"] = o2,
  54. })
  55. o4 = Create("Weld",{
  56. ["Name"] = "WheelWeld",
  57. ["Parent"] = o2,
  58. ["Part0"] = o2,
  59. ["Part1"] = mas,
  60. })
  61. o6 = Create("Weld",{
  62. ["Parent"] = mas,
  63. ["Part0"] = o17,
  64. ["Part1"] = mas,
  65. })
  66. o7 = Create("Part",{
  67. ["Parent"] = o1,
  68. ["BrickColor"] = BrickColor.new("Really black"),
  69. ["Position"] = Vector3.new(-16.5, 2.25999975, 63.75),
  70. ["Rotation"] = Vector3.new(0, 90, 0),
  71. ["CFrame"] = CFrame.new(-16.5, 2.25999975, 63.75, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  72. ["FormFactor"] = Enum.FormFactor.Custom,
  73. ["Size"] = Vector3.new(5, 0.5, 0.5),
  74. ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  75. ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  76. ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  77. ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  78. ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  79. ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  80. ["Color"] = Color3.new(0.0666667, 0.0666667, 0.0666667),
  81. })
  82. o8 = Create("Weld",{
  83. ["Parent"] = o7,
  84. ["Part0"] = o17,
  85. ["Part1"] = o7,
  86. })
  87. o9 = Create("Part",{
  88. ["Name"] = "Thruster",
  89. ["Parent"] = o1,
  90. ["Transparency"] = 1,
  91. ["Position"] = Vector3.new(-15.25, 2.50999975, 61.25),
  92. ["Rotation"] = Vector3.new(0, 90, 0),
  93. ["CFrame"] = CFrame.new(-15.25, 2.50999975, 61.25, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  94. ["CanCollide"] = false,
  95. ["FormFactor"] = Enum.FormFactor.Custom,
  96. ["Size"] = Vector3.new(1, 1, 2),
  97. ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  98. ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  99. ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  100. ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  101. ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  102. ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  103. })
  104. o10 = Create("Weld",{
  105. ["Parent"] = o9,
  106. ["Part0"] = o17,
  107. ["Part1"] = o9,
  108. })
  109. o11 = Create("Weld",{
  110. ["Name"] = "WheelWeld",
  111. ["Parent"] = o9,
  112. ["Part0"] = o9,
  113. ["Part1"] = mas,
  114. })
  115. o13 = Create("Weld",{
  116. ["Parent"] = mas,
  117. ["Part0"] = o17,
  118. ["Part1"] = mas,
  119. })
  120. o14 = Create("Part",{
  121. ["Name"] = "Thruster",
  122. ["Parent"] = o1,
  123. ["Transparency"] = 1,
  124. ["Position"] = Vector3.new(-7.75, 2.50999975, 61.25),
  125. ["Rotation"] = Vector3.new(0, 90, 0),
  126. ["CFrame"] = CFrame.new(-7.75, 2.50999975, 61.25, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  127. ["CanCollide"] = false,
  128. ["FormFactor"] = Enum.FormFactor.Custom,
  129. ["Size"] = Vector3.new(1, 1, 2),
  130. ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  131. ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  132. ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  133. ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  134. ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  135. ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  136. })
  137. o15 = Create("Weld",{
  138. ["Parent"] = o14,
  139. ["Part0"] = o17,
  140. ["Part1"] = o14,
  141. })
  142. o16 = Create("Weld",{
  143. ["Name"] = "WheelWeld",
  144. ["Parent"] = o14,
  145. ["Part0"] = o14,
  146. ["Part1"] = mas,
  147. })
  148. o17 = Create("Part",{
  149. ["Name"] = "Chassis",
  150. ["Parent"] = o1,
  151. ["BrickColor"] = BrickColor.new("Really black"),
  152. ["Position"] = Vector3.new(-11.25, 2.50999975, 63.75),
  153. ["Rotation"] = Vector3.new(0, 90, 0),
  154. ["CFrame"] = CFrame.new(-11.25, 2.50999975, 63.75, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  155. ["FormFactor"] = Enum.FormFactor.Custom,
  156. ["Size"] = Vector3.new(4, 1, 10),
  157. ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  158. ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  159. ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  160. ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  161. ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  162. ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  163. ["Color"] = Color3.new(0.0666667, 0.0666667, 0.0666667),
  164. })
  165. o18 = Create("Part",{
  166. ["Parent"] = o1,
  167. ["BrickColor"] = BrickColor.new("Institutional white"),
  168. ["Position"] = Vector3.new(-7.75, 3.75999975, 63.75),
  169. ["Rotation"] = Vector3.new(0, 90, 0),
  170. ["CFrame"] = CFrame.new(-7.75, 3.75999975, 63.75, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  171. ["FormFactor"] = Enum.FormFactor.Custom,
  172. ["Size"] = Vector3.new(4, 1.5, 3),
  173. ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  174. ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  175. ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  176. ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  177. ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  178. ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  179. ["Color"] = Color3.new(0.972549, 0.972549, 0.972549),
  180. })
  181. o19 = Create("Weld",{
  182. ["Parent"] = o18,
  183. ["Part0"] = o17,
  184. ["Part1"] = o18,
  185. })
  186. o21 = Create("Weld",{
  187. ["Parent"] = mas,
  188. ["Part0"] = o17,
  189. ["Part1"] = mas,
  190. })
  191. o23 = Create("Weld",{
  192. ["Parent"] = mas,
  193. ["Part0"] = o17,
  194. ["Part1"] = mas,
  195. })
  196. o24 = Create("Part",{
  197. ["Name"] = "Thruster",
  198. ["Parent"] = o1,
  199. ["Transparency"] = 1,
  200. ["Position"] = Vector3.new(-7.75, 2.50999975, 66.25),
  201. ["Rotation"] = Vector3.new(0, 90, 0),
  202. ["CFrame"] = CFrame.new(-7.75, 2.50999975, 66.25, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  203. ["CanCollide"] = false,
  204. ["FormFactor"] = Enum.FormFactor.Custom,
  205. ["Size"] = Vector3.new(1, 1, 2),
  206. ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  207. ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  208. ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  209. ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  210. ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  211. ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  212. })
  213. o25 = Create("Weld",{
  214. ["Parent"] = o24,
  215. ["Part0"] = o17,
  216. ["Part1"] = o24,
  217. })
  218. o26 = Create("Weld",{
  219. ["Name"] = "WheelWeld",
  220. ["Parent"] = o24,
  221. ["Part0"] = o24,
  222. ["Part1"] = mas,
  223. })
  224. o28 = Create("Weld",{
  225. ["Parent"] = mas,
  226. ["Part0"] = o17,
  227. ["Part1"] = mas,
  228. })
  229. o29 = Create("Part",{
  230. ["Parent"] = o1,
  231. ["BrickColor"] = BrickColor.new("Institutional white"),
  232. ["Position"] = Vector3.new(-6, 3.75999975, 63.75),
  233. ["Rotation"] = Vector3.new(0, 90, 0),
  234. ["CFrame"] = CFrame.new(-6, 3.75999975, 63.75, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  235. ["FormFactor"] = Enum.FormFactor.Custom,
  236. ["Size"] = Vector3.new(4, 2.5, 0.5),
  237. ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  238. ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  239. ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  240. ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  241. ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  242. ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  243. ["Color"] = Color3.new(0.972549, 0.972549, 0.972549),
  244. })
  245. o30 = Create("Weld",{
  246. ["Parent"] = o29,
  247. ["Part0"] = o17,
  248. ["Part1"] = o29,
  249. })
  250. o31 = Create("Part",{
  251. ["Parent"] = o1,
  252. ["BrickColor"] = BrickColor.new("Really black"),
  253. ["Position"] = Vector3.new(-6, 2.25999975, 63.75),
  254. ["Rotation"] = Vector3.new(0, 90, 0),
  255. ["CFrame"] = CFrame.new(-6, 2.25999975, 63.75, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  256. ["FormFactor"] = Enum.FormFactor.Custom,
  257. ["Size"] = Vector3.new(5, 0.5, 0.5),
  258. ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  259. ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  260. ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  261. ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  262. ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  263. ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  264. ["Color"] = Color3.new(0.0666667, 0.0666667, 0.0666667),
  265. })
  266. o32 = Create("Weld",{
  267. ["Parent"] = o31,
  268. ["Part0"] = o17,
  269. ["Part1"] = o31,
  270. })
  271. o34 = Create("Weld",{
  272. ["Parent"] = mas,
  273. ["Part0"] = o17,
  274. ["Part1"] = mas,
  275. })
  276. o35 = Create("Seat",{
  277. ["Name"] = "DriveSeat",
  278. ["Parent"] = o1,
  279. ["Position"] = Vector3.new(-10.75, 3.05999994, 63.75),
  280. ["Rotation"] = Vector3.new(0, 90, 0),
  281. ["CFrame"] = CFrame.new(-10.75, 3.05999994, 63.75, 0, 0, 1, 0, 1, -0, -1, 0, 0),
  282. ["FormFactor"] = Enum.FormFactor.Custom,
  283. ["Size"] = Vector3.new(2, 0.200000003, 2),
  284. ["BottomSurface"] = Enum.SurfaceType.Smooth,
  285. ["TopSurface"] = Enum.SurfaceType.Smooth,
  286. })
  287. o36 = Create("Weld",{
  288. ["Parent"] = o35,
  289. ["Part0"] = o17,
  290. ["Part1"] = o35,
  291. })
  292. o37 = Create("Part",{
  293. ["Name"] = "Light",
  294. ["Parent"] = o1,
  295. ["BrickColor"] = BrickColor.new("Really black"),
  296. ["Position"] = Vector3.new(-16.6000004, 4.00999975, 62.25),
  297. ["Rotation"] = Vector3.new(45, 90, 0),
  298. ["CFrame"] = CFrame.new(-16.6000004, 4.00999975, 62.25, 2.46918255e-008, 5.96113381e-008, 1, 0.707106769, 0.707106769, -5.96113381e-008, -0.707106769, 0.707106769, -2.46918255e-008),
  299. ["FormFactor"] = Enum.FormFactor.Custom,
  300. ["Size"] = Vector3.new(1, 1, 0.5),
  301. ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  302. ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  303. ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  304. ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  305. ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  306. ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  307. ["Color"] = Color3.new(0.0666667, 0.0666667, 0.0666667),
  308. })
  309. o38 = Create("SurfaceGui",{
  310. ["Parent"] = o37,
  311. ["CanvasSize"] = Vector2.new(100, 100),
  312. })
  313. o39 = Create("Frame",{
  314. ["Parent"] = o38,
  315. ["Position"] = UDim2.new(0.10000000149012,0,0.10000000149012,0),
  316. ["Size"] = UDim2.new(0.80000001192093,0,0.80000001192093,0),
  317. ["BackgroundColor3"] = Color3.new(1, 1, 1),
  318. ["BorderSizePixel"] = 0,
  319. })
  320. o40 = Create("SurfaceLight",{
  321. ["Parent"] = o37,
  322. ["Brightness"] = 0.5,
  323. ["Range"] = 32,
  324. ["Angle"] = 60,
  325. })
  326. o41 = Create("Weld",{
  327. ["Parent"] = o37,
  328. ["Part0"] = o17,
  329. ["Part1"] = o37,
  330. })
  331. o42 = Create("Part",{
  332. ["Name"] = "Light",
  333. ["Parent"] = o1,
  334. ["BrickColor"] = BrickColor.new("Really black"),
  335. ["Position"] = Vector3.new(-16.6000004, 4.00999975, 65.25),
  336. ["Rotation"] = Vector3.new(45, 90, 0),
  337. ["CFrame"] = CFrame.new(-16.6000004, 4.00999975, 65.25, -2.83364479e-008, -6.84102304e-008, 1, 0.707106769, 0.707106769, 6.84102304e-008, -0.707106769, 0.707106769, 2.83364479e-008),
  338. ["FormFactor"] = Enum.FormFactor.Custom,
  339. ["Size"] = Vector3.new(1, 1, 0.5),
  340. ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  341. ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  342. ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  343. ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  344. ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  345. ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
  346. ["Color"] = Color3.new(0.0666667, 0.0666667, 0.0666667),
  347. })
  348. o43 = Create("SurfaceGui",{
  349. ["Parent"] = o42,
  350. ["CanvasSize"] = Vector2.new(100, 100),
  351. })
  352. o44 = Create("Frame",{
  353. ["Parent"] = o43,
  354. ["Position"] = UDim2.new(0.10000000149012,0,0.10000000149012,0),
  355. ["Size"] = UDim2.new(0.80000001192093,0,0.80000001192093,0),
  356. ["BackgroundColor3"] = Color3.new(1, 1, 1),
  357. ["BorderSizePixel"] = 0,
  358. })
  359. o45 = Create("SurfaceLight",{
  360. ["Parent"] = o42,
  361. ["Brightness"] = 0.5,
  362. ["Range"] = 32,
  363. ["Angle"] = 60,
  364. })
  365. o46 = Create("Weld",{
  366. ["Parent"] = o42,
  367. ["Part0"] = o17,
  368. ["Part1"] = o42,
  369. })
  370. o47 = Create("Configuration",{
  371. ["Name"] = "Configurations",
  372. ["Parent"] = o1,
  373. })
  374. o48 = Create("NumberValue",{
  375. ["Name"] = "Bounce",
  376. ["Parent"] = o47,
  377. ["Value"] = 100,
  378. })
  379. o49 = Create("NumberValue",{
  380. ["Name"] = "Height",
  381. ["Parent"] = o47,
  382. ["Value"] = 3,
  383. })
  384. o50 = Create("NumberValue",{
  385. ["Name"] = "Speed",
  386. ["Parent"] = o47,
  387. ["Value"] = 80,
  388. })
  389. o51 = Create("NumberValue",{
  390. ["Name"] = "Suspension",
  391. ["Parent"] = o47,
  392. ["Value"] = 4,
  393. })
  394. o52 = Create("NumberValue",{
  395. ["Name"] = "TurnSpeed",
  396. ["Parent"] = o47,
  397. ["Value"] = 2,
  398. })
  399. o53 = Create("Script",{
  400. ["Name"] = "CarScript",
  401. ["Parent"] = o1,
  402. })
  403. table.insert(cors,coroutine.create(function()
  404. wait()
  405. runDummyScript(function()
  406. --Scripted by DermonDarble
  407.  
  408. local car = script.Parent
  409. local stats = car.Configurations
  410. local Raycast = require(script.RaycastModule)
  411.  
  412. local mass = 0
  413.  
  414. for i, v in pairs(car:GetChildren()) do
  415. if v:IsA("BasePart") then
  416. mass = mass + (v:GetMass() * 196.2)
  417. end
  418. end
  419.  
  420. local bodyPosition = Instance.new("BodyPosition", car.Chassis)
  421. bodyPosition.MaxForce = Vector3.new()
  422. local bodyGyro = Instance.new("BodyGyro", car.Chassis)
  423. bodyGyro.MaxTorque = Vector3.new()
  424.  
  425. local function UpdateThruster(thruster)
  426. -- Raycasting
  427. local hit, position = Raycast.new(thruster.Position, thruster.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value) --game.Workspace:FindPartOnRay(ray, car)
  428. local thrusterHeight = (position - thruster.Position).magnitude
  429.  
  430. -- Wheel
  431. local wheelWeld = thruster:FindFirstChild("WheelWeld")
  432. wheelWeld.C0 = CFrame.new(0, -math.min(thrusterHeight, stats.Height.Value * 0.8) + (wheelWeld.Part1.Size.Y / 2), 0)
  433. -- Wheel turning
  434. local offset = car.Chassis.CFrame:inverse() * thruster.CFrame
  435. local speed = car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity)
  436. if offset.Z < 0 then
  437. local direction = 1
  438. if speed.Z > 0 then
  439. direction = -1
  440. end
  441. wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(0, (car.Chassis.RotVelocity.Y / 2) * direction, 0)
  442. end
  443.  
  444. -- Particles
  445. if hit and thruster.Velocity.magnitude >= 5 then
  446. wheelWeld.Part1.ParticleEmitter.Enabled = true
  447. else
  448. wheelWeld.Part1.ParticleEmitter.Enabled = false
  449. end
  450. end
  451.  
  452. car.DriveSeat.Changed:connect(function(property)
  453. if property == "Occupant" then
  454. if car.DriveSeat.Occupant then
  455. local player = game.Players:GetPlayerFromCharacter(car.DriveSeat.Occupant.Parent)
  456. if player then
  457. car.DriveSeat:SetNetworkOwner(player)
  458. local localCarScript = script.LocalCarScript:Clone()
  459. localCarScript.Parent = player.PlayerGui
  460. localCarScript.Car.Value = car
  461. localCarScript.Disabled = false
  462. end
  463. end
  464. end
  465. end)
  466.  
  467. spawn(function()
  468. while true do
  469. game:GetService("RunService").Stepped:wait()
  470. for i, part in pairs(car:GetChildren()) do
  471. if part.Name == "Thruster" then
  472. UpdateThruster(part)
  473. end
  474. end
  475. if car.DriveSeat.Occupant then
  476. bodyPosition.MaxForce = Vector3.new()
  477. bodyGyro.MaxTorque = Vector3.new()
  478. else
  479. local hit, position, normal = Raycast.new(car.Chassis.Position, car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value)
  480. if hit and hit.CanCollide then
  481. bodyPosition.MaxForce = Vector3.new(mass / 5, math.huge, mass / 5)
  482. bodyPosition.Position = (CFrame.new(position, position + normal) * CFrame.new(0, 0, -stats.Height.Value + 0.5)).p
  483. bodyGyro.MaxTorque = Vector3.new(math.huge, 0, math.huge)
  484. bodyGyro.CFrame = CFrame.new(position, position + normal) * CFrame.Angles(-math.pi/2, 0, 0)
  485. else
  486. bodyPosition.MaxForce = Vector3.new()
  487. bodyGyro.MaxTorque = Vector3.new()
  488. end
  489. end
  490. end
  491. end)
  492. end,o53)
  493. end))
  494. o54 = Create("LocalScript",{
  495. ["Name"] = "LocalCarScript",
  496. ["Parent"] = o53,
  497. ["Disabled"] = true,
  498. })
  499. table.insert(cors,coroutine.create(function()
  500. wait()
  501. runDummyScript(function()
  502. --Scripted by DermonDarble
  503. local userInputService = game:GetService("UserInputService")
  504. local camera = game.Workspace.CurrentCamera
  505. local player = game.Players.LocalPlayer
  506. local character = player.Character
  507. local humanoidRootPart = character.HumanoidRootPart
  508. local car = script:WaitForChild("Car").Value
  509. local stats = car:WaitForChild("Configurations")
  510. local Raycast = require(car.CarScript.RaycastModule)
  511.  
  512. local cameraType = Enum.CameraType.Follow
  513.  
  514. local movement = Vector2.new()
  515. local gamepadDeadzone = 0.14
  516.  
  517. -- Input begin
  518. userInputService.InputBegan:connect(function(inputObject, gameProcessedEvent)
  519. if not gameProcessedEvent then
  520. if inputObject.KeyCode == Enum.KeyCode.W then
  521. movement = Vector2.new(movement.X, 1)
  522. elseif inputObject.KeyCode == Enum.KeyCode.A then
  523. movement = Vector2.new(-1, movement.Y)
  524. elseif inputObject.KeyCode == Enum.KeyCode.S then
  525. movement = Vector2.new(movement.X, -1)
  526. elseif inputObject.KeyCode == Enum.KeyCode.D then
  527. movement = Vector2.new(1, movement.Y)
  528. end
  529. end
  530. end)
  531.  
  532. --Mobile support
  533. local mobileGui = script.MobileGui
  534. if userInputService.TouchEnabled then
  535. userInputService.ModalEnabled = true
  536. mobileGui.Parent = player.PlayerGui
  537.  
  538. mobileGui.DrivePad.Up.MouseButton1Down:connect(function()
  539. movement = Vector2.new(movement.X, 1)
  540. end)
  541. mobileGui.DrivePad.Up.MouseButton1Up:connect(function()
  542. movement = Vector2.new(movement.X, 0)
  543. end)
  544. mobileGui.DrivePad.Down.MouseButton1Down:connect(function()
  545. movement = Vector2.new(movement.X, -1)
  546. end)
  547. mobileGui.DrivePad.Down.MouseButton1Up:connect(function()
  548. movement = Vector2.new(movement.X, 0)
  549. end)
  550. mobileGui.TurnPad.Left.MouseButton1Down:connect(function()
  551. movement = Vector2.new(-1, movement.Y)
  552. end)
  553. mobileGui.TurnPad.Left.MouseButton1Up:connect(function()
  554. movement = Vector2.new(0, movement.Y)
  555. end)
  556. mobileGui.TurnPad.Right.MouseButton1Down:connect(function()
  557. movement = Vector2.new(1, movement.Y)
  558. end)
  559. mobileGui.TurnPad.Right.MouseButton1Up:connect(function()
  560. movement = Vector2.new(0, movement.Y)
  561. end)
  562.  
  563. mobileGui.ExitButton.Text = "Exit " .. car.Name
  564. mobileGui.ExitButton.MouseButton1Click:connect(function()
  565. character.Humanoid.Jump = true
  566. end)
  567. else
  568. mobileGui:Destroy()
  569. end
  570.  
  571. --Gamepad support
  572. userInputService.InputChanged:connect(function(inputObject, gameProcessedEvent)
  573. --if not gameProcessedEvent then
  574. if inputObject.KeyCode == Enum.KeyCode.Thumbstick1 then
  575. if inputObject.Position.magnitude >= gamepadDeadzone then
  576. movement = Vector2.new(movement.X, inputObject.Position.Y)
  577. else
  578. movement = Vector2.new(movement.X, 0)
  579. end
  580. elseif inputObject.KeyCode == Enum.KeyCode.Thumbstick2 then
  581. if inputObject.Position.magnitude >= gamepadDeadzone then
  582. movement = Vector2.new(inputObject.Position.X, movement.Y)
  583. else
  584. movement = Vector2.new(0, movement.Y)
  585. end
  586. end
  587. --end
  588. end)
  589.  
  590. -- Input end
  591. userInputService.InputEnded:connect(function(inputObject, gameProcessedEvent)
  592. if inputObject.KeyCode == Enum.KeyCode.W then
  593. if movement.Y == 1 then
  594. movement = Vector2.new(movement.X, 0)
  595. end
  596. elseif inputObject.KeyCode == Enum.KeyCode.A then
  597. if movement.X == -1 then
  598. movement = Vector2.new(0, movement.Y)
  599. end
  600. elseif inputObject.KeyCode == Enum.KeyCode.S then
  601. if movement.Y == -1 then
  602. movement = Vector2.new(movement.X, 0)
  603. end
  604. elseif inputObject.KeyCode == Enum.KeyCode.D then
  605. if movement.X == 1 then
  606. movement = Vector2.new(0, movement.Y)
  607. end
  608. end
  609. end)
  610.  
  611. local force = 0
  612. local damping = 0
  613.  
  614. local mass = 0
  615.  
  616. for i, v in pairs(car:GetChildren()) do
  617. if v:IsA("BasePart") then
  618. mass = mass + (v:GetMass() * 196.2)
  619. end
  620. end
  621.  
  622. force = mass * stats.Suspension.Value
  623. damping = force / stats.Bounce.Value
  624.  
  625. local bodyVelocity = Instance.new("BodyVelocity", car.Chassis)
  626. bodyVelocity.velocity = Vector3.new(0, 0, 0)
  627. bodyVelocity.maxForce = Vector3.new(0, 0, 0)
  628.  
  629. local bodyAngularVelocity = Instance.new("BodyAngularVelocity", car.Chassis)
  630. bodyAngularVelocity.angularvelocity = Vector3.new(0, 0, 0)
  631. bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)
  632.  
  633. local rotation = 0
  634.  
  635. local function UpdateThruster(thruster)
  636. --Make sure we have a bodythrust to move the wheel
  637. local bodyThrust = thruster:FindFirstChild("BodyThrust")
  638. if not bodyThrust then
  639. bodyThrust = Instance.new("BodyThrust", thruster)
  640. end
  641. --Do some raycasting to get the height of the wheel
  642. local hit, position = Raycast.new(thruster.Position, thruster.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value)
  643. local thrusterHeight = (position - thruster.Position).magnitude
  644. if hit and hit.CanCollide then
  645. --If we're on the ground, apply some forces to push the wheel up
  646. bodyThrust.force = Vector3.new(0, ((stats.Height.Value - thrusterHeight)^2) * (force / stats.Height.Value^2), 0)
  647. local thrusterDamping = thruster.CFrame:toObjectSpace(CFrame.new(thruster.Velocity + thruster.Position)).p * damping
  648. bodyThrust.force = bodyThrust.force - Vector3.new(0, thrusterDamping.Y, 0)
  649. else
  650. bodyThrust.force = Vector3.new(0, 0, 0)
  651. end
  652.  
  653. --Wheels
  654. local wheelWeld = thruster:FindFirstChild("WheelWeld")
  655. if wheelWeld then
  656. wheelWeld.C0 = CFrame.new(0, -math.min(thrusterHeight, stats.Height.Value * 0.8) + (wheelWeld.Part1.Size.Y / 2), 0)
  657. -- Wheel turning
  658. local offset = car.Chassis.CFrame:inverse() * thruster.CFrame
  659. local speed = car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity)
  660. if offset.Z < 0 then
  661. local direction = 1
  662. if speed.Z > 0 then
  663. direction = -1
  664. end
  665. wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(0, (car.Chassis.RotVelocity.Y / 2) * direction, 0)
  666. end
  667. wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(rotation, 0, 0)
  668. end
  669. end
  670.  
  671. --A simple function to check if the car is grounded
  672. local function IsGrounded()
  673. local hit, position = Raycast.new((car.Chassis.CFrame * CFrame.new(0, 0, (car.Chassis.Size.Z / 2) - 1)).p, car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * (stats.Height.Value + 0.2))
  674. if hit and hit.CanCollide then
  675. return(true)
  676. end
  677. return(false)
  678. end
  679.  
  680. local oldCameraType = camera.CameraType
  681. camera.CameraType = cameraType
  682.  
  683. spawn(function()
  684. while character.Humanoid.SeatPart == car.DriveSeat do
  685. game:GetService("RunService").RenderStepped:wait()
  686.  
  687. --Broken gyro input
  688. --[[if userInputService.GyroscopeEnabled then
  689. local inputObject, cframe = userInputService:GetDeviceRotation()
  690. local up = cframe:vectorToWorldSpace(Vector3.new(0, 1, 0))
  691. local angle = (1 - up.Y) * (math.abs(up.X) / up.X)
  692. movement = Vector2.new(angle, movement.Y)
  693. end]]
  694.  
  695. if IsGrounded() then
  696. if movement.Y ~= 0 then
  697. local velocity = car.Chassis.CFrame.lookVector * movement.Y * stats.Speed.Value
  698. car.Chassis.Velocity = car.Chassis.Velocity:Lerp(velocity, 0.1)
  699. bodyVelocity.maxForce = Vector3.new(0, 0, 0)
  700. else
  701. bodyVelocity.maxForce = Vector3.new(mass / 2, mass / 4, mass / 2)
  702. end
  703. local rotVelocity = car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(movement.Y * stats.Speed.Value / 50, 0, -car.Chassis.RotVelocity.Y * 5 * movement.Y))
  704. local speed = -car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity).unit.Z
  705. rotation = rotation + math.rad((-stats.Speed.Value / 5) * movement.Y)
  706. if math.abs(speed) > 0.1 then
  707. rotVelocity = rotVelocity + car.Chassis.CFrame:vectorToWorldSpace((Vector3.new(0, -movement.X * speed * stats.TurnSpeed.Value, 0)))
  708. bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)
  709. else
  710. bodyAngularVelocity.maxTorque = Vector3.new(mass / 4, mass / 2, mass / 4)
  711. end
  712. car.Chassis.RotVelocity = car.Chassis.RotVelocity:Lerp(rotVelocity, 0.1)
  713.  
  714. --bodyVelocity.maxForce = Vector3.new(mass / 3, mass / 6, mass / 3)
  715. --bodyAngularVelocity.maxTorque = Vector3.new(mass / 6, mass / 3, mass / 6)
  716. else
  717. bodyVelocity.maxForce = Vector3.new(0, 0, 0)
  718. bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)
  719. end
  720.  
  721. for i, part in pairs(car:GetChildren()) do
  722. if part.Name == "Thruster" then
  723. UpdateThruster(part)
  724. end
  725. end
  726. end
  727. for i, v in pairs(car:GetChildren()) do
  728. if v:FindFirstChild("BodyThrust") then
  729. v.BodyThrust:Destroy()
  730. end
  731. end
  732. bodyVelocity:Destroy()
  733. bodyAngularVelocity:Destroy()
  734. camera.CameraType = oldCameraType
  735. userInputService.ModalEnabled = false
  736. if mobileGui then
  737. mobileGui:Destroy()
  738. end
  739. script:Destroy()
  740. end)
  741. end,o54)
  742. end))
  743. o55 = Create("ObjectValue",{
  744. ["Name"] = "Car",
  745. ["Parent"] = o54,
  746. })
  747. o56 = Create("ScreenGui",{
  748. ["Name"] = "MobileGui",
  749. ["Parent"] = o54,
  750. })
  751. o57 = Create("Frame",{
  752. ["Name"] = "DrivePad",
  753. ["Parent"] = o56,
  754. ["Transparency"] = 1,
  755. ["Position"] = UDim2.new(0,32,1,-156),
  756. ["Size"] = UDim2.new(0,64,0,128),
  757. ["BackgroundColor3"] = Color3.new(1, 1, 1),
  758. ["BackgroundTransparency"] = 1,
  759. })
  760. o58 = Create("ImageButton",{
  761. ["Name"] = "Up",
  762. ["Parent"] = o57,
  763. ["Transparency"] = 1,
  764. ["Size"] = UDim2.new(0,64,0,64),
  765. ["BackgroundColor3"] = Color3.new(1, 1, 1),
  766. ["BackgroundTransparency"] = 1,
  767. ["Image"] = "rbxasset://textures/ui/DPadSheet.png",
  768. ["ImageRectOffset"] = Vector2.new(0, 256),
  769. ["ImageRectSize"] = Vector2.new(128, 128),
  770. })
  771. o59 = Create("ImageButton",{
  772. ["Name"] = "Down",
  773. ["Parent"] = o57,
  774. ["Transparency"] = 1,
  775. ["Position"] = UDim2.new(0,0,1,-64),
  776. ["Size"] = UDim2.new(0,64,0,64),
  777. ["BackgroundColor3"] = Color3.new(1, 1, 1),
  778. ["BackgroundTransparency"] = 1,
  779. ["Image"] = "rbxasset://textures/ui/DPadSheet.png",
  780. ["ImageRectSize"] = Vector2.new(128, 128),
  781. })
  782. o60 = Create("Frame",{
  783. ["Name"] = "TurnPad",
  784. ["Parent"] = o56,
  785. ["Transparency"] = 1,
  786. ["Position"] = UDim2.new(1,-156,1,-96),
  787. ["Size"] = UDim2.new(0,128,0,64),
  788. ["BackgroundColor3"] = Color3.new(1, 1, 1),
  789. ["BackgroundTransparency"] = 1,
  790. })
  791. o61 = Create("ImageButton",{
  792. ["Name"] = "Left",
  793. ["Parent"] = o60,
  794. ["Transparency"] = 1,
  795. ["Size"] = UDim2.new(0,64,0,64),
  796. ["BackgroundColor3"] = Color3.new(1, 1, 1),
  797. ["BackgroundTransparency"] = 1,
  798. ["Image"] = "rbxasset://textures/ui/DPadSheet.png",
  799. ["ImageRectOffset"] = Vector2.new(128, 128),
  800. ["ImageRectSize"] = Vector2.new(128, 128),
  801. })
  802. o62 = Create("ImageButton",{
  803. ["Name"] = "Right",
  804. ["Parent"] = o60,
  805. ["Transparency"] = 1,
  806. ["Position"] = UDim2.new(1,-64,0,0),
  807. ["Size"] = UDim2.new(0,64,0,64),
  808. ["BackgroundColor3"] = Color3.new(1, 1, 1),
  809. ["BackgroundTransparency"] = 1,
  810. ["Image"] = "rbxasset://textures/ui/DPadSheet.png",
  811. ["ImageRectOffset"] = Vector2.new(0, 128),
  812. ["ImageRectSize"] = Vector2.new(128, 128),
  813. })
  814. o63 = Create("TextButton",{
  815. ["Name"] = "ExitButton",
  816. ["Parent"] = o56,
  817. ["Transparency"] = 0.5,
  818. ["Position"] = UDim2.new(1,-128,0,0),
  819. ["Size"] = UDim2.new(0,128,0,32),
  820. ["Text"] = "Exit",
  821. ["BackgroundColor3"] = Color3.new(0.121569, 0.121569, 0.121569),
  822. ["BackgroundTransparency"] = 0.5,
  823. ["BorderSizePixel"] = 0,
  824. ["Font"] = Enum.Font.SourceSans,
  825. ["FontSize"] = Enum.FontSize.Size18,
  826. ["TextColor3"] = Color3.new(1, 1, 1),
  827. ["TextStrokeColor3"] = Color3.new(0.133333, 0.133333, 0.133333),
  828. ["TextStrokeTransparency"] = 0.75,
  829. })
  830. o66 = Create("Texture",{
  831. ["Parent"] = mas,
  832. ["Transparency"] = 0.5,
  833. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  834. ["Face"] = Enum.NormalId.Top,
  835. ["StudsPerTileU"] = 3,
  836. ["StudsPerTileV"] = 3,
  837. })
  838. o67 = Create("Texture",{
  839. ["Parent"] = mas,
  840. ["Transparency"] = 0.5,
  841. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  842. ["StudsPerTileU"] = 3,
  843. ["StudsPerTileV"] = 3,
  844. })
  845. o68 = Create("Texture",{
  846. ["Parent"] = mas,
  847. ["Transparency"] = 0.5,
  848. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  849. ["Face"] = Enum.NormalId.Back,
  850. ["StudsPerTileU"] = 3,
  851. ["StudsPerTileV"] = 3,
  852. })
  853. o69 = Create("Texture",{
  854. ["Parent"] = mas,
  855. ["Transparency"] = 0.5,
  856. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  857. ["Face"] = Enum.NormalId.Bottom,
  858. ["StudsPerTileU"] = 3,
  859. ["StudsPerTileV"] = 3,
  860. })
  861. o70 = Create("ParticleEmitter",{
  862. ["Parent"] = mas,
  863. ["Transparency"] = NumberSequence.new(1,0.80000001192093,0.66874998807907,0.67499995231628,0.8125,1),
  864. ["Rotation"] = NumberRange.new(0,360),
  865. ["Size"] = NumberSequence.new(0,0.53763449192047,0.80645143985748,0.91397821903229),
  866. ["Color"] = ColorSequence.new(Color3.new(0.121569, 0.121569, 0.121569),Color3.new(0.121569, 0.121569, 0.121569)),
  867. ["Enabled"] = false,
  868. ["LightEmission"] = 0.20000000298023,
  869. ["Texture"] = "rbxassetid://287259619",
  870. ["Acceleration"] = Vector3.new(0, -5, 0),
  871. ["Lifetime"] = NumberRange.new(0.80000001192093,1.2000000476837),
  872. ["Rate"] = 50,
  873. ["RotSpeed"] = NumberRange.new(-200,200),
  874. ["Speed"] = NumberRange.new(0,0),
  875. ["VelocitySpread"] = 40,
  876. })
  877. o72 = Create("Texture",{
  878. ["Parent"] = mas,
  879. ["Transparency"] = 0.5,
  880. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  881. ["Face"] = Enum.NormalId.Top,
  882. ["StudsPerTileU"] = 3,
  883. ["StudsPerTileV"] = 3,
  884. })
  885. o73 = Create("Texture",{
  886. ["Parent"] = mas,
  887. ["Transparency"] = 0.5,
  888. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  889. ["StudsPerTileU"] = 3,
  890. ["StudsPerTileV"] = 3,
  891. })
  892. o74 = Create("Texture",{
  893. ["Parent"] = mas,
  894. ["Transparency"] = 0.5,
  895. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  896. ["Face"] = Enum.NormalId.Back,
  897. ["StudsPerTileU"] = 3,
  898. ["StudsPerTileV"] = 3,
  899. })
  900. o75 = Create("Texture",{
  901. ["Parent"] = mas,
  902. ["Transparency"] = 0.5,
  903. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  904. ["Face"] = Enum.NormalId.Bottom,
  905. ["StudsPerTileU"] = 3,
  906. ["StudsPerTileV"] = 3,
  907. })
  908. o76 = Create("ParticleEmitter",{
  909. ["Parent"] = mas,
  910. ["Transparency"] = NumberSequence.new(1,0.80000001192093,0.66874998807907,0.67499995231628,0.8125,1),
  911. ["Rotation"] = NumberRange.new(0,360),
  912. ["Size"] = NumberSequence.new(0,0.53763449192047,0.80645143985748,0.91397821903229),
  913. ["Color"] = ColorSequence.new(Color3.new(0.121569, 0.121569, 0.121569),Color3.new(0.121569, 0.121569, 0.121569)),
  914. ["Enabled"] = false,
  915. ["LightEmission"] = 0.20000000298023,
  916. ["Texture"] = "rbxassetid://287259619",
  917. ["Acceleration"] = Vector3.new(0, -5, 0),
  918. ["Lifetime"] = NumberRange.new(0.80000001192093,1.2000000476837),
  919. ["Rate"] = 50,
  920. ["RotSpeed"] = NumberRange.new(-200,200),
  921. ["Speed"] = NumberRange.new(0,0),
  922. ["VelocitySpread"] = 40,
  923. })
  924. o78 = Create("Texture",{
  925. ["Parent"] = mas,
  926. ["Transparency"] = 0.5,
  927. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  928. ["Face"] = Enum.NormalId.Top,
  929. ["StudsPerTileU"] = 3,
  930. ["StudsPerTileV"] = 3,
  931. })
  932. o79 = Create("Texture",{
  933. ["Parent"] = mas,
  934. ["Transparency"] = 0.5,
  935. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  936. ["StudsPerTileU"] = 3,
  937. ["StudsPerTileV"] = 3,
  938. })
  939. o80 = Create("Texture",{
  940. ["Parent"] = mas,
  941. ["Transparency"] = 0.5,
  942. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  943. ["Face"] = Enum.NormalId.Back,
  944. ["StudsPerTileU"] = 3,
  945. ["StudsPerTileV"] = 3,
  946. })
  947. o81 = Create("Texture",{
  948. ["Parent"] = mas,
  949. ["Transparency"] = 0.5,
  950. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  951. ["Face"] = Enum.NormalId.Bottom,
  952. ["StudsPerTileU"] = 3,
  953. ["StudsPerTileV"] = 3,
  954. })
  955. o82 = Create("ParticleEmitter",{
  956. ["Parent"] = mas,
  957. ["Transparency"] = NumberSequence.new(1,0.80000001192093,0.66874998807907,0.67499995231628,0.8125,1),
  958. ["Rotation"] = NumberRange.new(0,360),
  959. ["Size"] = NumberSequence.new(0,0.53763449192047,0.80645143985748,0.91397821903229),
  960. ["Color"] = ColorSequence.new(Color3.new(0.121569, 0.121569, 0.121569),Color3.new(0.121569, 0.121569, 0.121569)),
  961. ["Enabled"] = false,
  962. ["LightEmission"] = 0.20000000298023,
  963. ["Texture"] = "rbxassetid://287259619",
  964. ["Acceleration"] = Vector3.new(0, -5, 0),
  965. ["Lifetime"] = NumberRange.new(0.80000001192093,1.2000000476837),
  966. ["Rate"] = 50,
  967. ["RotSpeed"] = NumberRange.new(-200,200),
  968. ["Speed"] = NumberRange.new(0,0),
  969. ["VelocitySpread"] = 40,
  970. })
  971. o84 = Create("Texture",{
  972. ["Parent"] = mas,
  973. ["Transparency"] = 0.5,
  974. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  975. ["Face"] = Enum.NormalId.Top,
  976. ["StudsPerTileU"] = 3,
  977. ["StudsPerTileV"] = 3,
  978. })
  979. o85 = Create("Texture",{
  980. ["Parent"] = mas,
  981. ["Transparency"] = 0.5,
  982. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  983. ["StudsPerTileU"] = 3,
  984. ["StudsPerTileV"] = 3,
  985. })
  986. o86 = Create("Texture",{
  987. ["Parent"] = mas,
  988. ["Transparency"] = 0.5,
  989. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  990. ["Face"] = Enum.NormalId.Back,
  991. ["StudsPerTileU"] = 3,
  992. ["StudsPerTileV"] = 3,
  993. })
  994. o87 = Create("Texture",{
  995. ["Parent"] = mas,
  996. ["Transparency"] = 0.5,
  997. ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
  998. ["Face"] = Enum.NormalId.Bottom,
  999. ["StudsPerTileU"] = 3,
  1000. ["StudsPerTileV"] = 3,
  1001. })
  1002. o88 = Create("ParticleEmitter",{
  1003. ["Parent"] = mas,
  1004. ["Transparency"] = NumberSequence.new(1,0.80000001192093,0.66874998807907,0.67499995231628,0.8125,1),
  1005. ["Rotation"] = NumberRange.new(0,360),
  1006. ["Size"] = NumberSequence.new(0,0.53763449192047,0.80645143985748,0.91397821903229),
  1007. ["Color"] = ColorSequence.new(Color3.new(0.121569, 0.121569, 0.121569),Color3.new(0.121569, 0.121569, 0.121569)),
  1008. ["Enabled"] = false,
  1009. ["LightEmission"] = 0.20000000298023,
  1010. ["Texture"] = "rbxassetid://287259619",
  1011. ["Acceleration"] = Vector3.new(0, -5, 0),
  1012. ["Lifetime"] = NumberRange.new(0.80000001192093,1.2000000476837),
  1013. ["Rate"] = 50,
  1014. ["RotSpeed"] = NumberRange.new(-200,200),
  1015. ["Speed"] = NumberRange.new(0,0),
  1016. ["VelocitySpread"] = 40,
  1017. })
  1018. o89 = Create("Part",{
  1019. ["Name"] = "Spikes",
  1020. ["Parent"] = o1,
  1021. ["Transparency"] = 1,
  1022. ["Position"] = Vector3.new(-5.7395401, 3.24998713, 63.6900024),
  1023. ["Rotation"] = Vector3.new(0, 90, 0),
  1024. ["CFrame"] = CFrame.new(-5.7395401, 3.24998713, 63.6900024, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  1025. ["FormFactor"] = Enum.FormFactor.Custom,
  1026. ["Size"] = Vector3.new(5.10000134, 3.60000324, 0.200000003),
  1027. ["BottomSurface"] = Enum.SurfaceType.Weld,
  1028. ["TopSurface"] = Enum.SurfaceType.Smooth,
  1029. })
  1030. o90 = Create("Script",{
  1031. ["Name"] = "RunOver",
  1032. ["Parent"] = o89,
  1033. })
  1034. table.insert(cors,coroutine.create(function()
  1035. wait()
  1036. runDummyScript(function()
  1037. function onTouched(hit)
  1038. local human = hit.Parent:findFirstChild("Humanoid")
  1039. if human and human:IsA("Humanoid") then
  1040. human:TakeDamage(100)
  1041. script.Parent.Parent.CarHP.Value=script.Parent.Parent.CarHP.Value-25
  1042. end
  1043. end
  1044.  
  1045. script.Parent.Touched:connect(onTouched)
  1046. end,o90)
  1047. end))
  1048. o91 = Create("ManualWeld",{
  1049. ["Name"] = "Weld",
  1050. ["Parent"] = o89,
  1051. ["Part0"] = o89,
  1052. ["Part1"] = o17,
  1053. })
  1054. o92 = Create("NumberValue",{
  1055. ["Name"] = "CarHP",
  1056. ["Parent"] = o1,
  1057. ["Value"] = 5000,
  1058. })
  1059. o93 = Create("Script",{
  1060. ["Parent"] = o92,
  1061. })
  1062. table.insert(cors,coroutine.create(function()
  1063. wait()
  1064. runDummyScript(function()
  1065. while true do
  1066. wait()
  1067. if script.Parent.Value==0 or script.Parent.Value < 0 then
  1068. local ex=Instance.new("Explosion")
  1069. ex.Position=script.Parent.Parent.Chassis.Position
  1070. ex.Parent=game.Workspace
  1071. ex.BlastPressure=12500000
  1072. ex.BlastRadius=10
  1073. wait()
  1074. game.Workspace.Jeep:Destroy()
  1075. end
  1076. print("(Jeep1)HP:"..script.Parent.Value)
  1077. end
  1078. end,o93)
  1079. end))
  1080. o94 = Create("Part",{
  1081. ["Name"] = "Spikes",
  1082. ["Parent"] = o1,
  1083. ["Transparency"] = 1,
  1084. ["Position"] = Vector3.new(-16.869545, 4.05998993, 63.6900024),
  1085. ["Rotation"] = Vector3.new(0, 90, 0),
  1086. ["CFrame"] = CFrame.new(-16.869545, 4.05998993, 63.6900024, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  1087. ["FormFactor"] = Enum.FormFactor.Custom,
  1088. ["Size"] = Vector3.new(5.10000134, 3.60000324, 0.200000003),
  1089. ["BottomSurface"] = Enum.SurfaceType.Weld,
  1090. ["TopSurface"] = Enum.SurfaceType.Smooth,
  1091. })
  1092. o95 = Create("Script",{
  1093. ["Name"] = "RunOver",
  1094. ["Parent"] = o94,
  1095. })
  1096. table.insert(cors,coroutine.create(function()
  1097. wait()
  1098. runDummyScript(function()
  1099. function onTouched(hit)
  1100. local human = hit.Parent:findFirstChild("Humanoid")
  1101. if human and human:IsA("Humanoid") then
  1102. human:TakeDamage(100)
  1103. script.Parent.Parent.CarHP.Value=script.Parent.Parent.CarHP.Value-25
  1104. end
  1105. end
  1106.  
  1107. script.Parent.Touched:connect(onTouched)
  1108. end,o95)
  1109. end))
  1110. o96 = Create("ManualWeld",{
  1111. ["Name"] = "Weld",
  1112. ["Parent"] = o94,
  1113. ["Part0"] = o17,
  1114. ["Part1"] = o94,
  1115. })
  1116. o97 = Create("Script",{
  1117. ["Name"] = "CollisionMarker",
  1118. ["Parent"] = o94,
  1119. })
  1120. table.insert(cors,coroutine.create(function()
  1121. wait()
  1122. runDummyScript(function()
  1123. script.Parent.Touched:connect(function(h)
  1124. wait()
  1125. local can=true
  1126. if not h.Parent:FindFirstChild("Humanoid") and can==true then
  1127. can=false
  1128. script.Parent.Parent.CarHP.Value=script.Parent.Parent.CarHP.Value-50
  1129. wait(1)
  1130. can=true
  1131. end
  1132.  
  1133.  
  1134.  
  1135.  
  1136. end)
  1137. end,o97)
  1138. end))
  1139.  
  1140. mas.Parent = workspace
  1141. mas:MakeJoints()
  1142. local mas1 = mas:GetChildren()
  1143. for i=1,#mas1 do
  1144. mas1[i].Parent = workspace
  1145. ypcall(function() mas1[i]:MakeJoints() end)
  1146. end
  1147. mas:Destroy()
  1148. for i=1,#cors do
  1149. coroutine.resume(cors[i])
  1150. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement