Batmobile


SUBMITTED BY: Pamlau

DATE: March 8, 2017, 10:20 a.m.

FORMAT: Lua

SIZE: 38.9 kB

HITS: 315

  1. print("Loaded")
  2. local modelName="BatMobile"
  3. local player
  4. local torso
  5. --#Local Functions
  6. local c=function(f) coroutine.resume(coroutine.create(f)) end
  7. --#Settings
  8. local inf=math.huge
  9. local pi=math.pi
  10. local mr=math.rad
  11. local ms=math.sin
  12. local mc=math.cos
  13. local mrand=math.random
  14. local cn=CFrame.new
  15. local ca=CFrame.Angles
  16. local ti=table.insert
  17. local tr=table.remove
  18. local model2=Instance.new("Model", workspace) model2.Name=modelName
  19. local gui=Instance.new("ScreenGui") gui.Name=modelName
  20. local skincolor="Really black"
  21. local body={}
  22. local animate={}
  23. local obj={}
  24. local dmg=mrand(10000, 10000)
  25. local mouse
  26. local walkSpeed=100
  27. local combo=0
  28. local switch=0
  29. local key=false
  30. local hit=false
  31. local block=false
  32. local trails
  33. local speed=0
  34. local add={
  35. Part=function(par, a, c, col, t, s, cf, ms)
  36. local p=Instance.new("Part", par) pcall(function() p.TopSurface="Smooth" p.BottomSurface="Smooth" p.formFactor="Custom" p.Anchored=a p.CanCollide=c p.BrickColor=BrickColor.new(col) p.Transparency=t p.Size=s p.CFrame=cf or cn() end)
  37. local m=Instance.new("BlockMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) end)
  38. return p
  39. end;
  40. Cylinder=function(par, a, c, col, t, s, cf, ms)
  41. local p=Instance.new("Part", par) pcall(function() p.TopSurface="Smooth" p.BottomSurface="Smooth" p.formFactor="Custom" p.Anchored=a p.CanCollide=c p.BrickColor=BrickColor.new(col) p.Transparency=t p.Size=s p.CFrame=cf or cn() end)
  42. local m=Instance.new("CylinderMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) end)
  43. return p
  44. end;
  45. Wedge=function(par, a, c, col, t, s, cf, ms)
  46. local p=Instance.new("WedgePart", par) pcall(function() p.TopSurface="Smooth" p.BottomSurface="Smooth" p.formFactor="Custom" p.Anchored=a p.CanCollide=c p.BrickColor=BrickColor.new(col) p.Transparency=t p.Size=s p.CFrame=cf or cn() end)
  47. local m=Instance.new("SpecialMesh", p) pcall(function() m.Scale=ms or Vector3.new(1, 1, 1) m.MeshType="Wedge" end)
  48. return p
  49. end;
  50. Gui=function(ins, par, bc, bg, tc, fs, text, t, s, pos)
  51. local g=Instance.new(ins, par) pcall(function() g.BorderColor=BrickColor.new(bc) g.BackgroundColor=BrickColor.new(bg) g.TextColor=BrickColor.new(tc) g.FontSize=fs g.Font="ArialBold" g.Text=text g.BackgroundTransparency=t g.Size=s g.Position=pos end)
  52. return g
  53. end;
  54. Weld=function(par, p1, cf)
  55. local w=Instance.new("Weld", par) pcall(function() w.Part0=w.Parent or par w.Part1=p1 w.C1=cf or cn() end)
  56. return w
  57. end;
  58. Mesh=function(ins, par, s, t, id, tid, of)
  59. pcall(function() for i, v in pairs(par:children()) do if v:isA("BlockMesh") or v:isA("CylinderMesh") or v:isA("SpecialMesh") then v:remove() end end end)
  60. local m=Instance.new(ins, par) pcall(function() m.Scale=s or Vector3.new(1, 1, 1) m.Offset=of or Vector3.new() m.MeshId=id or "" m.TextureId=tid or "" m.MeshType=t end)
  61. return m
  62. end;
  63. Sound=function(parent, id, pitch, volume)
  64. local s=Instance.new("Sound", parent) pcall(function() s.SoundId=id s.Volume=volume or 1 s.Pitch=pitch or 1 end)
  65. return s
  66. end;
  67. }
  68. local Sounds={
  69. Slash="rbxasset://sounds//swordslash.wav";
  70. Hit="http://www.roblox.com/asset/?id=11113679 ";
  71. Equip="rbxasset://sounds/unsheath.wav";
  72. Charge="http://www.roblox.com/asset/?id=2101137";
  73. ElectricShortage="http://roblox.com/asset/?id=10209481";
  74. ElectricSound="http://www.roblox.com/asset/?id=10756118";
  75. Electric="http://www.roblox.com/asset/?id=2800815";
  76. Abscond="http://www.roblox.com/asset/?id=2767090";
  77. Cannon="http://www.roblox.com/asset/?id=2920959";
  78. Bash="http://www.roblox.com/asset/?id=25270310";
  79. Suirize="http://roblox.com/asset/?id=10209605";
  80. Heli="http://www.roblox.com/asset/?id=27112125";
  81. }
  82. local Decals={
  83. }
  84. local Meshes={
  85. Charge="http://www.roblox.com/asset/?id=20329976";
  86. Noob="http://www.roblox.com/asset/?id=29515710";
  87. Ring="http://www.roblox.com/asset/?id=3270017";
  88. Crown="http://www.roblox.com/asset/?id=1323306";
  89. Spring="http://www.roblox.com/Asset/?id=9753878";
  90. Sword="rbxasset://fonts/sword.mesh";
  91. Shield="http://www.roblox.com/asset/?id=50798797";
  92. Diamond="http://www.roblox.com/Asset/?id=9756362";
  93. Shuriken="http://www.roblox.com/asset/?id=11112101";
  94. ShurikenT="http://www.roblox.com/asset/?id=11112112"
  95. }
  96. function createParts()
  97. --#GuiDescendants
  98. obj.AL=add.Gui("TextLabel", gui, "Really black", "Really black", "White", "Size18", "Speed(speed)", 0, UDim2.new(0, 150, 0, 50), UDim2.new(0, 0, 0, 150))
  99. obj.AL2=add.Gui("TextLabel", obj.AL, "Really black", "Really black", "White", "Size18", "HeavyBreak(V)", 0, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  100. obj.AL3=add.Gui("TextLabel", obj.AL2, "Really black", "Really black", "White", "Size18", "Rocket(R)", 0, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  101. obj.AL4=add.Gui("TextLabel", obj.AL3, "Really black", "Really black", "White", "Size18", "MachineGun(F)", 0, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  102. obj.AL5=add.Gui("TextLabel", obj.AL4, "Really black", "Really black", "White", "Size18", "Boost(B)", 0, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  103. obj.AL6=add.Gui("TextLabel", obj.AL5, "Really black", "Really black", "White", "Size18", "Blade(C)", 0, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  104. obj.AL7=add.Gui("TextLabel", obj.AL6, "Really black", "Really black", "White", "Size18", "Hover(X)", 0, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  105. obj.AL8=add.Gui("TextLabel", obj.AL7, "Really black", "Really black", "White", "Size18", "SelfDestruct(G)", 0, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  106. -- obj.AL9=add.Gui("TextLabel", obj.AL8, "Really black", "Really black", "White", "Size18", "MaximumArmor(Z)", 0, UDim2.new(1, 0, 1, 0), UDim2.new(0, 0, 1, 0))
  107. --#CarDesgin
  108. for i, v in pairs(model2:children()) do
  109. if i~=1 then return end
  110. end
  111. obj.Frame=add.Part(model2, false, true, "Really black", 0, Vector3.new(5, 1, 10))
  112. obj.sup=add.Part(model2, false, true, "Really black", 0, Vector3.new(1, 1, 5))
  113. obj.supW=add.Weld(obj.sup, obj.Frame, cn(-3, 0, -5))
  114. obj.Wheels=add.Cylinder(model2, false, true, "White", 0, Vector3.new(3, 1.5, 3))
  115. obj.WheelsW=add.Weld(obj.Wheels, obj.sup, cn(1.25, 0, -3)*ca(0, 0, mr(90)))
  116. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(1, 1, 1))
  117. obj.wW=add.Weld(obj.w, obj.sup, cn(0, 0, -3)*ca(0, 0, mr(90)))
  118. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(1, 1, 5))
  119. obj.wW=add.Weld(obj.w, obj.sup, cn(0, 1, 0))
  120. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(1, 1, 5))
  121. obj.wW=add.Weld(obj.w, obj.sup, cn(0, -1, 0)*ca(0, 0, pi))
  122. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(.5, 1, 2))
  123. obj.wW=add.Weld(obj.w, obj.Frame, cn(-2, 0, -6)*ca(0, 0, -mr(90)))
  124. obj.sup=add.Part(model2, false, true, "Really black", 0, Vector3.new(1, 1, 5))
  125. obj.supW=add.Weld(obj.sup, obj.Frame, cn(3, 0, -5))
  126. obj.Wheels2=add.Cylinder(model2, false, true, "White", 0, Vector3.new(3, 1.5, 3))
  127. obj.Wheels2W=add.Weld(obj.Wheels2, obj.sup, cn(-1.25, 0, -3)*ca(0, 0, mr(90)))
  128. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(1, 1, 1))
  129. obj.wW=add.Weld(obj.w, obj.sup, cn(0, 0, -3)*ca(0, 0, mr(-90)))
  130. obj.w=add.Wedge(model2, false, true, "Really black",0, Vector3.new(1, 1, 5))
  131. obj.wW=add.Weld(obj.w, obj.sup, cn(0, 1, 0))
  132. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(1, 1, 5))
  133. obj.wW=add.Weld(obj.w, obj.sup, cn(0, -1, 0)*ca(0, 0, pi))
  134. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(.5, 1, 2))
  135. obj.wW=add.Weld(obj.w, obj.Frame, cn(2, 0, -6)*ca(0, 0, mr(90)))
  136. obj.Wheel3=add.Cylinder(model2, false, true, "White", 0, Vector3.new(4.5, 2, 4.5))
  137. obj.Wheel3W=add.Weld(obj.Wheel3, obj.Frame, cn(3.5, .5, 5)*ca(0, 0, mr(90)))
  138. obj.Wheel4=add.Cylinder(model2, false, true, "White", 0, Vector3.new(4.5, 2, 4.5))
  139. obj.Wheel4W=add.Weld(obj.Wheel4, obj.Frame, cn(-3.5, .5, 5)*ca(0, 0, mr(-90)))
  140. obj.sR=add.Cylinder(model2, false, true, "Really black", 0, Vector3.new(3.5, 6, 3.5))
  141. obj.sRW=add.Weld(obj.sR, obj.Frame, cn(2.6, 0, 0)*ca(mr(90), 0, 0))
  142. obj.sL=add.Cylinder(model2, false, true, "Really black", 0, Vector3.new(3.5, 6, 3.5))
  143. obj.sLW=add.Weld(obj.sL, obj.Frame, cn(-2.6, 0, 0)*ca(mr(90), 0, 0))
  144. obj.VC=Instance.new("VehicleSeat", model2) obj.VC.HeadsUpDisplay=false obj.VC.CanCollide=false
  145. obj.VC.Size=Vector3.new(2, 1, 2)
  146. obj.VC.BottomSurface="Weld"
  147. obj.VCW=add.Weld(obj.VC, obj.Frame, cn(0, .2, 0))
  148. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(1, 1, 5))
  149. obj.wW=add.Weld(obj.w, obj.Frame, cn(0, 0, -5.5)*ca(0, pi/2, -pi/2))
  150. obj.w=add.Wedge(model2, false, true, "Really black",0, Vector3.new(1, 1, 5))
  151. obj.wW=add.Weld(obj.w, obj.Frame, cn(0, 0, -5.5)*ca(0, -pi/2, pi/2))
  152. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(1.5, 1, 3))
  153. obj.wW=add.Weld(obj.w, obj.Frame, cn(0, 0, -7)*ca(0, 0, 0))
  154. obj.p=add.Part(model2, false, true, "Really black", 0, Vector3.new(4, .5, 1))
  155. obj.pW=add.Weld(obj.p, obj.Frame, cn(0, .5, -5))
  156. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(.5, 3, 4))
  157. obj.wW=add.Weld(obj.w, obj.Frame, cn(.5, .6, -4.5)*ca(0, pi/2, -pi/2))
  158. obj.w=add.Wedge(model2, false, false, "Really black", .5, Vector3.new(1, 2, 1.5))
  159. obj.wW=add.Weld(obj.w, obj.Frame, cn(2, 1.25, -3.25)*ca(0, 0, -pi/2))
  160. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(.5, 3, 4))
  161. obj.wW=add.Weld(obj.w, obj.Frame, cn(-.5, .6, -4.5)*ca(0, -pi/2, pi/2))
  162. obj.w=add.Wedge(model2, false, false, "Really black", .5, Vector3.new(1, 2, 1.5))
  163. obj.wW=add.Weld(obj.w, obj.Frame, cn(-2, 1.25, -3.25)*ca(0, 0, pi/2))
  164. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(2, 1, 1.5))
  165. obj.wW=add.Weld(obj.w, obj.Frame, cn(0, 1.25, -4.75)*ca(0, 0, 0))
  166. obj.ps=add.Part(model2, false, false, "Really black", 0, Vector3.new(4, 1, 5))
  167. obj.psW=add.Weld(obj.ps, obj.Frame, cn(0, 2, 0))
  168. obj.w=add.Wedge(model2, false, false, "Really black", 0, Vector3.new(2, 1, 1.5))
  169. obj.wW=add.Weld(obj.w, obj.ps, cn(0, 0, -3.25)*ca(0, 0, 0))
  170. obj.w=add.Wedge(model2, false, false, "Really black", 0, Vector3.new(5, 1, 2))
  171. obj.wW=add.Weld(obj.w, obj.ps, cn(3, 0, 0)*ca(0, -pi/2, 0))
  172. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(5, 2, 1))
  173. obj.wW=add.Weld(obj.w, obj.ps, cn(3.5, -1.5, 0)*ca(pi, -pi/2, 0))
  174. obj.w=add.Wedge(model2, false, false, "Really black", 0, Vector3.new(5, 1, 2))
  175. obj.wW=add.Weld(obj.w, obj.ps, cn(-3, 0, 0)*ca(0, pi/2, 0))
  176. obj.w=add.Wedge(model2, false, true, "Really black", 0, Vector3.new(5, 2, 1))
  177. obj.wW=add.Weld(obj.w, obj.ps, cn(3.5, -1.5, 0)*ca(pi, -pi/2, 0))
  178. obj.csupt=add.Cylinder(model2, false, true, "Really black", 0, Vector3.new(1, 2.5, 1))
  179. obj.csuptW=add.Weld(obj.csupt, obj.Frame, cn(-3, 2, 2.5)*ca(mr(15), 0, 0))
  180. obj.csupt=add.Cylinder(model2, false, true, "Really black", 0, Vector3.new(1, 2.5, 1))
  181. obj.csuptW=add.Weld(obj.csupt, obj.Frame, cn(-2, 2, 2.5)*ca(mr(15), 0, 0))
  182. obj.p=add.Part(model2, false, false, "Really black", 0, Vector3.new(3.5, .2, 3))
  183. obj.pW=add.Weld(obj.p, obj.Frame, cn(-2.5, 3, 4))
  184. obj.csupt=add.Cylinder(model2, false, true, "Really black", 0, Vector3.new(1, 2.5, 1))
  185. obj.csuptW=add.Weld(obj.csupt, obj.Frame, cn(3, 2, 2.5)*ca(mr(15), 0, 0))
  186. obj.csupt=add.Cylinder(model2, false, true, "Really black", 0, Vector3.new(1, 2.5, 1))
  187. obj.csuptW=add.Weld(obj.csupt, obj.Frame, cn(2, 2, 2.5)*ca(mr(15), 0, 0))
  188. obj.p=add.Part(model2, false, false, "Really black", 0, Vector3.new(3.5, .2, 3))
  189. obj.pW=add.Weld(obj.p, obj.Frame, cn(2.5, 3, 4))
  190. obj.w=add.Wedge(model2, false, false, "Really black", 0, Vector3.new(5, 2, 2.5))
  191. obj.wW=add.Weld(obj.w, obj.ps, cn(0, -.5, 3.75)*ca(0, pi, 0))
  192. obj.c=add.Cylinder(model2, false, false, "Really black", 0, Vector3.new(3.5, 2, 3.5))
  193. obj.cW=add.Weld(obj.c, obj.Frame, cn(0, 1, 5)*ca(mr(90), 0, 0))
  194. obj.TS=add.Cylinder(model2, false, true, "Really black", 0, Vector3.new(3, 2, 3))
  195. obj.TSW=add.Weld(obj.TS, obj.c, cn(0, 1, 0)*ca(0, 0, 0))
  196. obj.TSM=add.Mesh("SpecialMesh", obj.TS, Vector3.new(.75, .1, .75), nil, "http://www.roblox.com/Asset/?id=10207677")
  197. obj.top=add.Part(model2, false, false, "Really black", 0, Vector3.new(4, 1.5, 4))
  198. obj.topW=add.Weld(obj.top, obj.ps, cn(0, .5, 0))
  199. obj.topM=add.Mesh("SpecialMesh", obj.top, Vector3.new(1, 1, 1), "Sphere")
  200. --Machine Gun
  201. obj.mr=add.Part(model2, false, false, "Really black", 0, Vector3.new(1, 1, 2))
  202. obj.mrw=add.Weld(obj.mr, obj.Frame, cn(0, 0, 0))
  203. obj.br=add.Part(model2, false, false, "Really black", 0, Vector3.new(1.5, 1.5, 2.5))
  204. obj.brw=add.Weld(obj.br, obj.mr, cn(1, 0, 0))
  205. obj.gr=add.Part(model2, false, false, "Really black", 0, Vector3.new(.5, .5, 1))
  206. obj.grw=add.Weld(obj.gr, obj.br, cn(0, 0, -1))
  207. obj.ml=add.Part(model2, false, false, "Really black", 0, Vector3.new(1, 1, 2))
  208. obj.mlw=add.Weld(obj.ml, obj.Frame, cn(0, 0, 0))
  209. obj.bl=add.Part(model2, false, false, "Really black", 0, Vector3.new(1.5, 1.5, 2.5))
  210. obj.blw=add.Weld(obj.bl, obj.ml, cn(-1, 0, 0))
  211. obj.gl=add.Part(model2, false, false, "Really black", 0, Vector3.new(.5, .5, 1))
  212. obj.glw=add.Weld(obj.gl, obj.bl, cn(0, 0, -1))
  213. --Rocket
  214. obj.rck=add.Cylinder(model2, false, false, "Really black", 0, Vector3.new(1, 4, 1))
  215. obj.rckw=add.Weld(obj.rck, obj.Frame, cn(0, 0, 0)*ca(-pi/2, 0, 0))
  216. obj.rock=add.Part(model2, false, false, "Really black", 1, Vector3.new(1, 1, 1))
  217. obj.rockw=add.Weld(obj.rock, obj.rck, cn(0, 1.5, 0)*ca(pi/2, 0, 0))
  218. --Blade
  219. obj.p1=add.Part(model2, false, false, "White", 0, Vector3.new(3, .2, 1))
  220. obj.p1w=add.Weld(obj.p1, obj.Frame, cn(0, 0, 0))
  221. obj.br=add.Wedge(model2,false, false, "White", 0, Vector3.new(.2, 2, 1))
  222. obj.brW=add.Weld(obj.br, obj.p1, cn(2.5, 0, 0)*ca(0, 0, -pi/2))
  223. obj.p2=add.Part(model2, false, false, "White", 0, Vector3.new(3, .2, 1))
  224. obj.p2w=add.Weld(obj.p2, obj.Frame, cn(0, 0, 0))
  225. obj.bl=add.Wedge(model2,false, false, "White", 0, Vector3.new(.2, 2, 1))
  226. obj.blW=add.Weld(obj.bl, obj.p2, cn(-2.5, 0, 0)*ca(0, 0, pi/2))
  227. --Animate
  228. animate={
  229. ["Wheel"]=function(cf)
  230. obj.Wheels2W.C1=cn(-1.25, 0, -3)*ca(0, 0, mr(90))*cf
  231. end,
  232. ["Wheel2"]=function(cf)
  233. obj.WheelsW.C1=cn(1.25, 0, -3)*ca(0, 0, mr(90))*cf
  234. end,
  235. ["Wheel3"]=function(cf)
  236. obj.Wheel3W.C1=cn(3.5, .5, 5)*ca(0, 0, mr(90))*cf
  237. end,
  238. ["Wheel4"]=function(cf)
  239. obj.Wheel4W.C1=cn(-3.5, .5, 5)*ca(0, 0, mr(-90))*cf
  240. end,
  241. ["MachineGunR"]=function(cf)
  242. obj.mrw.C1=cf
  243. end,
  244. ["MachineGunL"]=function(cf)
  245. obj.mlw.C1=cf
  246. end,
  247. ["MachineGunL"]=function(cf)
  248. obj.mlw.C1=cf
  249. end,
  250. ["Rocket"]=function(cf)
  251. obj.rckw.C1=cf*ca(-pi/2, 0, 0)
  252. end,
  253. ["BladeR"]=function(cf)
  254. obj.p1w.C1=cf
  255. end,
  256. ["BladeL"]=function(cf)
  257. obj.p2w.C1=cf
  258. end,
  259. ["Booster"]=function(cf)
  260. obj.cW.C1=cn(0, 1, 5)*ca(mr(90), 0, 0)*cf
  261. end,
  262. }
  263. end
  264. function play(soundid, pitch, volume)
  265. local sound=add.Sound(workspace, soundid, pitch, volume)
  266. sound:play()
  267. c(function() wait(5) sound:remove() end)
  268. end
  269. function fade(part, incr)
  270. if part:isA("BasePart") then
  271. for i=part.Transparency, 1, incr do part.Transparency=i wait() end
  272. elseif part:isA("Model") then
  273. for i, v in pairs(part:children() or part) do
  274. if v:isA("BasePart") then
  275. c(function()for i=v.Transparency, 1, incr do v.Transparency=i wait() end end)
  276. end
  277. end
  278. end
  279. end
  280. function appear(part, incr)
  281. if part:isA("BasePart") then
  282. for i=part.Transparency, 0, -incr do v.Transparency=i wait() end
  283. elseif part:isA("Model") then
  284. for i, v in pairs(part:children() or part) do
  285. if v:isA("BasePart") then
  286. c(function()for i=v.Transparency, 0, -incr do v.Transparency=i wait() end end)
  287. end
  288. end
  289. end
  290. end
  291. function computePos(pos, pos2)
  292. local pos3=Vector3.new(pos2.x, pos.y, pos2.z)
  293. return cn(pos, pos3)
  294. end
  295. function rayCast(pos, dir, max, ingore)
  296. return workspace:findPartOnRay(Ray.new(pos, dir.unit*(max or 999)), ignore)
  297. end
  298. function nearObj(pos, dis)
  299. local temp
  300. local distance=dis
  301. for i, v in pairs(workspace:children()) do
  302. if v:isA("Model") then
  303. temp=v:findFirstChild("Torso")
  304. local humanoid=v:findFirstChild("Humanoid")
  305. if temp and humanoid and v~=char and (temp.CFrame.p-pos).magnitude<distance then
  306. distance=(temp.CFrame.p-pos).magnitude
  307. return temp.Parent
  308. end
  309. end
  310. end
  311. end
  312. function trail(prt, cf, thick, col)
  313. c(function()
  314. trails=true
  315. local old=(prt.CFrame*(cf or cn())).p
  316. local trm=Instance.new("Model", workspace)
  317. while trails do
  318. local new=(prt.CFrame*(cf or cn())).p
  319. local mag=(old-new).magnitude
  320. local dis=(old+new)/2
  321. local trail=add.Cylinder(trm, true, false, col or "White", .2, Vector3.new(1, 1, 1), cn(dis, new)*ca(pi/2, 0, 0), Vector3.new(thick, mag, thick))
  322. old=new
  323. c(function()
  324. for i=1, 0, -.1 do trail.Mesh.Scale=trail.Mesh.Scale*Vector3.new(i, 1, i) wait() end
  325. trail:remove()
  326. end)
  327. wait()
  328. end
  329. trm:remove()
  330. end)
  331. end
  332. boosts=false
  333. function boost(prt, thick, col)
  334. c(function()
  335. boosts=true
  336. local trm=Instance.new("Model", workspace)
  337. while boosts do
  338. local ef=add.Part(trm, false, false, "Bright yellow", .2, Vector3.new(1, .5, 1))
  339. local efm=add.Mesh("SpecialMesh", ef, Vector3.new(thick, thick, thick), nil, Meshes.Crown)
  340. add.Weld(ef, prt, cn(0, 4, 0)*ca(0, mr(mrand(-360, 360)), 0))
  341. game.Debris:addItem(ef, .2)
  342. local trail=add.Part(trm, true, false, col or "White", .2, Vector3.new(1, 1, 1), prt.CFrame*cn(0, 2, 0)*ca(mr(mrand(-360, 360)), mr(mrand(-360, 360)), mr(mrand(-360, 360))), Vector3.new(thick, thick, thick))
  343. c(function()
  344. for i=1, 0, -.1 do trail.Mesh.Scale=trail.Mesh.Scale*Vector3.new(i, i, i) wait() end
  345. trail:remove()
  346. end)
  347. wait()
  348. end
  349. trm:remove()
  350. end)
  351. end
  352. function stickHit(from, to)
  353. local stickW=add.Weld(from, to, to.CFrame:inverse()*from.CFrame)
  354. stickW.C0=from.CFrame:inverse()*from.CFrame
  355. return stickW
  356. end
  357. function glowMesh(prt, size, speed)
  358. local glow=prt:clone() add.Weld(prt, glow)
  359. glow.Parent=workspace
  360. glow.Anchored=false
  361. glow.CanCollide=false
  362. for i, v in pairs(glow:children()) do
  363. if v:isA("SpecialMesh") or v:isA("BlockMesh") or v:isA("CylinderMesh") then
  364. c(function()
  365. for i=0, size, speed do v.Scale=v.Scale+Vector3.new(i, i, i) wait() end
  366. end)
  367. c(function()
  368. fade(glow, .1) glow:remove()
  369. end)
  370. end
  371. end
  372. end
  373. function sliceHit(prt)
  374. prt.Touched:connect(function(h)
  375. if key==true and not hit and h.Parent~=player.Character then
  376. hit=true
  377. pcall(function()
  378. print("Slicing")
  379. local pYPos=h.Position.y-(h.Size.y/2)
  380. local sYPos=prt.Position.y
  381. if sYPos<=pYPos or sYPos>=(pYPos+h.Size.y) then return end
  382. local p=h:clone() p.Parent=workspace p.Anchored=false p.CanCollide=true
  383. local p2=h:clone() p2.Parent=workspace p2.Anchored=false p2.CanCollide=true
  384. h:remove()
  385. p.formFactor="Custom"
  386. p2.formFactor="Custom"
  387. p.TopSurface="Smooth"
  388. p.BottomSurface="Smooth"
  389. p.Friction=0
  390. p2.Friction=0
  391. p.Size=Vector3.new(h.Size.x, sYPos-pYPos, h.Size.z)
  392. p2.Size=Vector3.new(h.Size.x, p2.Size.y-(sYPos-pYPos), h.Size.z)
  393. p.CFrame=h.CFrame*CFrame.new(0, -p2.Size.y/2, 0)
  394. p2.CFrame=h.CFrame*CFrame.new(0, p.Size.y/2, 0)
  395. c(function()
  396. wait(5)
  397. p:remove() p2:remove()
  398. end)
  399. end)
  400. wait(.1)
  401. hit=false
  402. end
  403. end)
  404. end
  405. function dmgHit(prt)
  406. prt.Touched:connect(function(h)
  407. if key==true and h.Parent:findFirstChild("Humanoid") and not hit and h.Parent~=player.Character then
  408. hit=true
  409. local fakeM=Instance.new("Model", workspace)
  410. fakeM.Name=-dmg*mrand(1, 1.5)
  411. local hHuman=h.Parent:findFirstChild("Humanoid")
  412. local hTorso=h.Parent:findFirstChild("Torso")
  413. local fakeH=Instance.new("Humanoid", fakeM) fakeH.MaxHealth=0 fakeH.Health=0
  414. local label=add.Part(fakeM, false, false, "Bright red", 0, Vector3.new(.2, .2, .2), h.CFrame*cn(mrand(-2, 2), 4, mrand(-2, 2)), Vector3.new(.1, .1, .1)) label.Name="Head"
  415. c(function()
  416. local bv=Instance.new("BodyVelocity", label)
  417. bv.maxForce=Vector3.new(inf, inf, inf)
  418. bv.velocity=Vector3.new(0, 4.5, 0)
  419. Game.Debris:addItem(fakeM, 1)
  420. end)
  421. hHuman.Health=hHuman.Health-dmg
  422. wait(.1)
  423. hit=false
  424. end
  425. end)
  426. end
  427. function rockHit(prt)
  428. prt.Touched:connect(function(h)
  429. if key==true and not hit and h.Parent~=player.Character then
  430. hit=true
  431. if h.Parent:findFirstChild("Humanoid") then
  432. local fakeM=Instance.new("Model", workspace)
  433. fakeM.Name=-dmg*mrand(2, 5.5)
  434. local hHuman=h.Parent:findFirstChild("Humanoid")
  435. local hTorso=h.Parent:findFirstChild("Torso")
  436. local fakeH=Instance.new("Humanoid", fakeM) fakeH.MaxHealth=0 fakeH.Health=0
  437. local label=add.Part(fakeM, false, false, "Bright red", 0, Vector3.new(.2, .2, .2), h.CFrame*cn(mrand(-2, 2), 4, mrand(-2, 2)), Vector3.new(.1, .1, .1)) label.Name="Head"
  438. c(function()
  439. local bv=Instance.new("BodyVelocity", label)
  440. bv.maxForce=Vector3.new(inf, inf, inf)
  441. bv.velocity=Vector3.new(0, 4.5, 0)
  442. Game.Debris:addItem(fakeM, 1)
  443. end)
  444. hHuman.Health=hHuman.Health-dmg
  445. end
  446. local e=Instance.new("Explosion", workspace)
  447. e.BlastPressure=2
  448. e.BlastRadius=4
  449. e.Position=h.Position
  450. prt:remove()
  451. wait()
  452. hit=false
  453. end
  454. end)
  455. end
  456. function makeCrater(cf, size)
  457. local to=cf.p-(cf.p+Vector3.new(0, 200, 0))
  458. local hit, pos=rayCast(cf.p, to)
  459. if hit and pos then
  460. for i=1, 3 do
  461. local cr=add.Part(workspace, true, false, hit.Color or "Brown", 0, Vector3.new(1+size, size, 2+size), cn(pos+Vector3.new(mrand(-2+size/2, 2+size/2), 0, mrand(-2+size/2, 2+size/2)))*ca(mr(mrand(-4, 4)), mr(mrand(-360, 360)), mr(mrand(-35, 35))))
  462. end
  463. end
  464. end
  465. function makeLightning(from, to, thick, col)
  466. local magnitude=(from.p-to.p).magnitude
  467. local distance=(from.p+to.p)/2
  468. local pattern=add.Part(workspace, true, false, "White", 1, Vector3.new(.2, .2, magnitude), cn(distance, from.p))
  469. local fromPosProx=from.p
  470. local lim=Instance.new("Model", workspace)
  471. for i=1, 4 do
  472. local fromPosProx2=fromPosProx
  473. local random=Vector3.new(mrand(-1, 1), mrand(-1, 1), mrand(-1, 1))
  474. local findSize=pattern.Size.z/4
  475. local findOffSet=pattern.CFrame.lookVector*-1
  476. local compute=i*findSize*findOffSet
  477. local newfromPos=from.p
  478. local newEndPos=cn(random+compute+newfromPos).p
  479. local magnitude=(fromPosProx2-newEndPos).magnitude
  480. local distance=(fromPosProx2+newEndPos)/2
  481. local lightning=add.Part(lim, true, false, col or "Bright yellow", 0, Vector3.new(1, 1, 1), cn(distance, fromPosProx2), Vector3.new(thick, thick, magnitude))
  482. fromPosProx=newEndPos
  483. game.Debris:addItem(lim, 1)
  484. end
  485. pattern:remove()
  486. end
  487. function makeCircle(prt ,dis, rep, angle)
  488. local cm=Instance.new("Model", prt.Parent)
  489. for i=angle*2/rep, angle*2 do
  490. local prt2=prt:clone()
  491. prt2.Parent=cm
  492. prt2.CFrame=prt.CFrame*cn(dis*ms(i), 0, dis*mc(i))
  493. end
  494. prt:remove()
  495. return cm
  496. end
  497. local bv=Instance.new("BodyVelocity") bv.maxForce=Vector3.new(inf, 0, inf)
  498. local bav=Instance.new("BodyAngularVelocity") bav.maxTorque=Vector3.new(inf, inf, inf)
  499. function startBoost()
  500. boost(obj.TS, 3, "Bright orange")
  501. while boosts do
  502. if speed<150 then
  503. speed=speed+2
  504. bv.velocity=obj.Frame.CFrame.lookVector*speed
  505. end
  506. wait()
  507. end
  508. end
  509. local fire=false
  510. function startMG()
  511. fire=true
  512. for i=0, 1, .1 do
  513. animate.MachineGunR(cn(4.5*i, 0, 0))
  514. animate.MachineGunL(cn(-4.5*i, 0, 0))
  515. wait()
  516. end
  517. while fire do
  518. local mb=add.Part(workspace, false, false, "Bright yellow", 0, Vector3.new(.2, .2, 1), obj.gr.CFrame+obj.gr.CFrame.lookVector)
  519. dmgHit(mb)
  520. local f=Instance.new("BodyForce", mb) f.force=Vector3.new(0, mb:getMass()*196.25, 0)
  521. local v=Instance.new("BodyVelocity", mb) v.maxForce=Vector3.new(inf, inf, inf) v.velocity=mb.CFrame.lookVector*200
  522. local ef=add.Part(workspace, false, false, "Bright yellow", .2, Vector3.new(1, .5, 1))
  523. local efm=add.Mesh("SpecialMesh", ef, Vector3.new(1, 1, 1), nil, Meshes.Crown)
  524. add.Weld(ef, obj.gr, cn(0, 0, -1)*ca(-pi/2, 0, 0))
  525. game.Debris:addItem(ef, .1)
  526. game.Debris:addItem(mb, 1.5)
  527. local mb2=add.Part(workspace, false, false, "Bright yellow", 0, Vector3.new(.2, .2, 1), obj.gl.CFrame+obj.gl.CFrame.lookVector)
  528. dmgHit(mb2)
  529. local f=Instance.new("BodyForce", mb2) f.force=Vector3.new(0, mb2:getMass()*196.25, 0)
  530. local v=Instance.new("BodyVelocity", mb2) v.maxForce=Vector3.new(inf, inf, inf) v.velocity=mb2.CFrame.lookVector*200
  531. local ef=add.Part(workspace, false, false, "Bright yellow", .2, Vector3.new(1, .5, 1))
  532. local efm=add.Mesh("SpecialMesh", ef, Vector3.new(1, 1, 1), nil, Meshes.Crown)
  533. add.Weld(ef, obj.gl, cn(0, 0, -1)*ca(-pi/2, 0, 0))
  534. game.Debris:addItem(ef, .1)
  535. game.Debris:addItem(mb2, 1.5)
  536. wait(.1)
  537. end
  538. for i=1, 0, -.1 do
  539. animate.MachineGunR(cn(4.5*i, 0, 0))
  540. animate.MachineGunL(cn(-4.5*i, 0, 0))
  541. wait()
  542. end
  543. end
  544. function startRocket()
  545. for i=0, 1, .1 do
  546. animate.Rocket(cn(0, 0, -8*i))
  547. wait()
  548. end
  549. wait(.2)
  550. local mb=add.Part(workspace, false, false, "Bright yellow", 0, Vector3.new(1, 1, 2), obj.rock.CFrame+obj.rock.CFrame.lookVector*2)
  551. rockHit(mb)
  552. local f=Instance.new("BodyForce", mb) f.force=Vector3.new(0, mb:getMass()*196.25, 0)
  553. local v=Instance.new("BodyVelocity", mb) v.maxForce=Vector3.new(inf, inf, inf) v.velocity=mb.CFrame.lookVector*300
  554. local ef=add.Part(workspace, false, false, "Bright yellow", .2, Vector3.new(1, .5, 1))
  555. local efm=add.Mesh("SpecialMesh", ef, Vector3.new(1.5, 1.5, 1.5), nil, Meshes.Crown)
  556. add.Weld(ef, obj.rock, cn(0, 0, -.5)*ca(-pi/2, 0, 0))
  557. game.Debris:addItem(ef, .1)
  558. game.Debris:addItem(mb, 1.5)
  559. wait(.2)
  560. for i=1, 0, -.1 do
  561. animate.Rocket(cn(0, 0, -8*i))
  562. wait()
  563. end
  564. end
  565. function startSelfDestruct()
  566. obj.VCW:remove()
  567. obj.VC.CanCollide=false
  568. local p=Instance.new("BodyPosition", obj.VC) p.maxForce=Vector3.new(inf, inf, inf) p.position=obj.VC.Position+Vector3.new(0, 300, 0)
  569. wait(1)
  570. local e=Instance.new("Explosion", workspace)
  571. e.BlastPressure=500
  572. e.BlastRadius=500
  573. e.Position=obj.Frame.Position
  574. end
  575. local slice=false
  576. function startSlice()
  577. slice=true
  578. for i=0, 1, .1 do
  579. animate.BladeR(cn(5.5*i, 0, 0))
  580. animate.BladeL(cn(-5.5*i, 0, 0))
  581. wait()
  582. end
  583. sliceHit(obj.p1) sliceHit(obj.p2)
  584. sliceHit(obj.br) sliceHit(obj.bl)
  585. while slice do wait() end
  586. for i=1, 0, -.1 do
  587. animate.BladeR(cn(5.5*i, 0, 0))
  588. animate.BladeL(cn(-5.5*i, 0, 0))
  589. wait()
  590. end
  591. end
  592. local hover=false
  593. function startHover()
  594. bv.maxForce=Vector3.new(inf, inf, inf)
  595. for i=0, 1, .05 do
  596. animate.Wheel(ca(0, 0, mr(90*i)))
  597. animate.Wheel2(ca(0, 0, mr(-90*i)))
  598. animate.Wheel3(ca(0, 0, mr(90*i)))
  599. animate.Wheel4(ca(0, 0, mr(-90*i)))
  600. animate.Booster(ca(mr(90*i), 0, 0))
  601. bv.velocity=bv.velocity+Vector3.new(0, 10*i, 0)
  602. wait()
  603. end
  604. boost(obj.TS, 3, "Bright orange")
  605. bv.velocity=Vector3.new(0, 0, 0)
  606. while hover do bv.velocity=bv.velocity+Vector3.new(0, 10, 0) wait(1) bv.velocity=Vector3.new(0, 0, 0) wait(.5) bv.velocity=bv.velocity-Vector3.new(0, 10, 0) wait(1) bv.velocity=Vector3.new(0, 0, 0) wait(.5) end
  607. for i=1, 0, -.05 do
  608. animate.Wheel(ca(0, 0, mr(90*i)))
  609. animate.Wheel2(ca(0, 0, mr(-90*i)))
  610. animate.Wheel3(ca(0, 0, mr(90*i)))
  611. animate.Wheel4(ca(0, 0, mr(-90*i)))
  612. animate.Booster(ca(mr(90*i), 0, 0))
  613. bv.velocity=bv.velocity-Vector3.new(0, 5-5*i, 0)
  614. wait()
  615. end
  616. bv.maxForce=Vector3.new(inf, 0, inf)
  617. boosts=false
  618. end
  619. function KeyDown(k)
  620. if k=="b" and not key and not boosts then
  621. key=true
  622. startBoost()
  623. end
  624. if k=="x" and not hover then
  625. hover=true
  626. startHover()
  627. elseif k=="x" and hover then
  628. hover=false
  629. end
  630. if k=="c" and not key and not slice then
  631. key=true
  632. startSlice()
  633. end
  634. if k=="r" and not key then
  635. key=true
  636. startRocket()
  637. key=false
  638. end
  639. if k=="g" and not key then
  640. key=true
  641. startSelfDestruct()
  642. key=false
  643. end
  644. if k=="f" and not key and not fire then
  645. key=true
  646. startMG()
  647. end
  648. if k=="v" and not key then
  649. key=true
  650. speed=0
  651. key=false
  652. end
  653. end
  654. function KeyUp(k)
  655. if k=="b" and boosts and key then
  656. key=false
  657. boosts=false
  658. end
  659. if k=="f" and fire and key then
  660. key=false
  661. fire=false
  662. end
  663. if k=="c" and slice and key then
  664. key=false
  665. slice=false
  666. end
  667. end
  668. local engine=false
  669. createParts()
  670. obj.VC.ChildAdded:connect(function(ad)
  671. if ad.Name=="SeatWeld" then
  672. torso=ad.Part1
  673. local vc=obj.VC
  674. if torso then print("Found")
  675. player=game.Players:getPlayerFromCharacter(torso.Parent)
  676. mouse=player:GetMouse()
  677. ad.C1=ad.C1*CFrame.new(0, 0, 1.5)
  678. bv.Parent=obj.Frame
  679. bav.Parent=obj.Frame
  680. gui.Parent=player.PlayerGui
  681. mouse.KeyDown:connect(KeyDown)
  682. mouse.KeyUp:connect(KeyUp)
  683. engine=true
  684. while torso and vc and engine do print("working")
  685. obj.AL.Text="Speed("..speed..")"
  686. if vc.Throttle==1 and speed<100 then
  687. speed=speed+1
  688. bv.velocity=obj.Frame.CFrame.lookVector*speed
  689. end
  690. if vc.Throttle==-1 and speed>-100 then
  691. speed=speed-1
  692. bv.velocity=obj.Frame.CFrame.lookVector*speed
  693. end
  694. if vc.Throttle==0 and speed>0 then
  695. speed=speed-1
  696. bv.velocity=obj.Frame.CFrame.lookVector*speed
  697. end
  698. if vc.Throttle==0 and speed<0 then
  699. speed=speed+1
  700. bv.velocity=obj.Frame.CFrame.lookVector*speed
  701. end
  702. if vc.Steer==1 then
  703. bav.angularvelocity=Vector3.new(0, -2, 0)
  704. if not hover then
  705. animate.Wheel2(ca(mr(-25), 0, 0))
  706. animate.Wheel(ca(mr(-25), 0, 0))
  707. end
  708. end
  709. if vc.Steer==-1 then
  710. bav.angularvelocity=Vector3.new(0, 2, 0)
  711. if not hover then
  712. animate.Wheel2(ca(mr(25), 0, 0))
  713. animate.Wheel(ca(mr(25), 0, 0))
  714. end
  715. end
  716. if vc.Steer==0 then
  717. bav.angularvelocity=Vector3.new(0, 0, 0)
  718. if not hover then
  719. animate.Wheel2(ca(0, 0, 0))
  720. animate.Wheel(ca(0, 0, 0))
  721. end
  722. end
  723. wait()
  724. end
  725. end
  726. end
  727. end)
  728. obj.VC.ChildRemoved:connect(function()
  729. bv.Parent=nil bav.Parent=nil gui.Parent=nil engine=false
  730. end)

comments powered by Disqus