Advertisement
MrWiggles1029

ROBLOX Batmobile

Sep 2nd, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.01 KB | None | 0 0
  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.  
  224. obj.p2=add.Part(model2, false, false, "White", 0, Vector3.new(3, .2, 1))
  225. obj.p2w=add.Weld(obj.p2, obj.Frame, cn(0, 0, 0))
  226. obj.bl=add.Wedge(model2,false, false, "White", 0, Vector3.new(.2, 2, 1))
  227. obj.blW=add.Weld(obj.bl, obj.p2, cn(-2.5, 0, 0)*ca(0, 0, pi/2))
  228. --Animate
  229. animate={
  230. ["Wheel"]=function(cf)
  231. obj.Wheels2W.C1=cn(-1.25, 0, -3)*ca(0, 0, mr(90))*cf
  232. end,
  233. ["Wheel2"]=function(cf)
  234. obj.WheelsW.C1=cn(1.25, 0, -3)*ca(0, 0, mr(90))*cf
  235. end,
  236. ["Wheel3"]=function(cf)
  237. obj.Wheel3W.C1=cn(3.5, .5, 5)*ca(0, 0, mr(90))*cf
  238. end,
  239. ["Wheel4"]=function(cf)
  240. obj.Wheel4W.C1=cn(-3.5, .5, 5)*ca(0, 0, mr(-90))*cf
  241. end,
  242. ["MachineGunR"]=function(cf)
  243. obj.mrw.C1=cf
  244. end,
  245. ["MachineGunL"]=function(cf)
  246. obj.mlw.C1=cf
  247. end,
  248. ["MachineGunL"]=function(cf)
  249. obj.mlw.C1=cf
  250. end,
  251. ["Rocket"]=function(cf)
  252. obj.rckw.C1=cf*ca(-pi/2, 0, 0)
  253. end,
  254. ["BladeR"]=function(cf)
  255. obj.p1w.C1=cf
  256. end,
  257. ["BladeL"]=function(cf)
  258. obj.p2w.C1=cf
  259. end,
  260. ["Booster"]=function(cf)
  261. obj.cW.C1=cn(0, 1, 5)*ca(mr(90), 0, 0)*cf
  262. end,
  263. }
  264. end
  265. function play(soundid, pitch, volume)
  266. local sound=add.Sound(workspace, soundid, pitch, volume)
  267. sound:play()
  268. c(function() wait(5) sound:remove() end)
  269. end
  270. function fade(part, incr)
  271. if part:isA("BasePart") then
  272. for i=part.Transparency, 1, incr do part.Transparency=i wait() end
  273. elseif part:isA("Model") then
  274. for i, v in pairs(part:children() or part) do
  275. if v:isA("BasePart") then
  276. c(function()for i=v.Transparency, 1, incr do v.Transparency=i wait() end end)
  277. end
  278. end
  279. end
  280. end
  281. function appear(part, incr)
  282. if part:isA("BasePart") then
  283. for i=part.Transparency, 0, -incr do v.Transparency=i wait() end
  284. elseif part:isA("Model") then
  285. for i, v in pairs(part:children() or part) do
  286. if v:isA("BasePart") then
  287. c(function()for i=v.Transparency, 0, -incr do v.Transparency=i wait() end end)
  288. end
  289. end
  290. end
  291. end
  292. function computePos(pos, pos2)
  293. local pos3=Vector3.new(pos2.x, pos.y, pos2.z)
  294. return cn(pos, pos3)
  295. end
  296. function rayCast(pos, dir, max, ingore)
  297. return workspace:findPartOnRay(Ray.new(pos, dir.unit*(max or 999)), ignore)
  298. end
  299. function nearObj(pos, dis)
  300. local temp
  301. local distance=dis
  302. for i, v in pairs(workspace:children()) do
  303. if v:isA("Model") then
  304. temp=v:findFirstChild("Torso")
  305. local humanoid=v:findFirstChild("Humanoid")
  306. if temp and humanoid and v~=char and (temp.CFrame.p-pos).magnitude<distance then
  307. distance=(temp.CFrame.p-pos).magnitude
  308. return temp.Parent
  309. end
  310. end
  311. end
  312. end
  313. function trail(prt, cf, thick, col)
  314. c(function()
  315. trails=true
  316. local old=(prt.CFrame*(cf or cn())).p
  317. local trm=Instance.new("Model", workspace)
  318. while trails do
  319. local new=(prt.CFrame*(cf or cn())).p
  320. local mag=(old-new).magnitude
  321. local dis=(old+new)/2
  322. 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))
  323. old=new
  324. c(function()
  325. for i=1, 0, -.1 do trail.Mesh.Scale=trail.Mesh.Scale*Vector3.new(i, 1, i) wait() end
  326. trail:remove()
  327. end)
  328. wait()
  329. end
  330. trm:remove()
  331. end)
  332. end
  333. boosts=false
  334. function boost(prt, thick, col)
  335. c(function()
  336. boosts=true
  337. local trm=Instance.new("Model", workspace)
  338. while boosts do
  339. local ef=add.Part(trm, false, false, "Bright yellow", .2, Vector3.new(1, .5, 1))
  340. local efm=add.Mesh("SpecialMesh", ef, Vector3.new(thick, thick, thick), nil, Meshes.Crown)
  341. add.Weld(ef, prt, cn(0, 4, 0)*ca(0, mr(mrand(-360, 360)), 0))
  342. game.Debris:addItem(ef, .2)
  343. 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))
  344. c(function()
  345. for i=1, 0, -.1 do trail.Mesh.Scale=trail.Mesh.Scale*Vector3.new(i, i, i) wait() end
  346. trail:remove()
  347. end)
  348. wait()
  349. end
  350. trm:remove()
  351. end)
  352. end
  353. function stickHit(from, to)
  354. local stickW=add.Weld(from, to, to.CFrame:inverse()*from.CFrame)
  355. stickW.C0=from.CFrame:inverse()*from.CFrame
  356. return stickW
  357. end
  358. function glowMesh(prt, size, speed)
  359. local glow=prt:clone() add.Weld(prt, glow)
  360. glow.Parent=workspace
  361. glow.Anchored=false
  362. glow.CanCollide=false
  363. for i, v in pairs(glow:children()) do
  364. if v:isA("SpecialMesh") or v:isA("BlockMesh") or v:isA("CylinderMesh") then
  365. c(function()
  366. for i=0, size, speed do v.Scale=v.Scale+Vector3.new(i, i, i) wait() end
  367. end)
  368. c(function()
  369. fade(glow, .1) glow:remove()
  370. end)
  371. end
  372. end
  373. end
  374. function sliceHit(prt)
  375. prt.Touched:connect(function(h)
  376. if key==true and not hit and h.Parent~=player.Character then
  377. hit=true
  378. pcall(function()
  379. print("Slicing")
  380. local pYPos=h.Position.y-(h.Size.y/2)
  381. local sYPos=prt.Position.y
  382. if sYPos<=pYPos or sYPos>=(pYPos+h.Size.y) then return end
  383. local p=h:clone() p.Parent=workspace p.Anchored=false p.CanCollide=true
  384. local p2=h:clone() p2.Parent=workspace p2.Anchored=false p2.CanCollide=true
  385. h:remove()
  386. p.formFactor="Custom"
  387. p2.formFactor="Custom"
  388. p.TopSurface="Smooth"
  389. p.BottomSurface="Smooth"
  390. p.Friction=0
  391. p2.Friction=0
  392. p.Size=Vector3.new(h.Size.x, sYPos-pYPos, h.Size.z)
  393. p2.Size=Vector3.new(h.Size.x, p2.Size.y-(sYPos-pYPos), h.Size.z)
  394. p.CFrame=h.CFrame*CFrame.new(0, -p2.Size.y/2, 0)
  395. p2.CFrame=h.CFrame*CFrame.new(0, p.Size.y/2, 0)
  396. c(function()
  397. wait(5)
  398. p:remove() p2:remove()
  399. end)
  400. end)
  401. wait(.1)
  402. hit=false
  403. end
  404. end)
  405. end
  406. function dmgHit(prt)
  407. prt.Touched:connect(function(h)
  408. if key==true and h.Parent:findFirstChild("Humanoid") and not hit and h.Parent~=player.Character then
  409. hit=true
  410. local fakeM=Instance.new("Model", workspace)
  411. fakeM.Name=-dmg*mrand(1, 1.5)
  412. local hHuman=h.Parent:findFirstChild("Humanoid")
  413. local hTorso=h.Parent:findFirstChild("Torso")
  414. local fakeH=Instance.new("Humanoid", fakeM) fakeH.MaxHealth=0 fakeH.Health=0
  415. 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"
  416. c(function()
  417. local bv=Instance.new("BodyVelocity", label)
  418. bv.maxForce=Vector3.new(inf, inf, inf)
  419. bv.velocity=Vector3.new(0, 4.5, 0)
  420. Game.Debris:addItem(fakeM, 1)
  421. end)
  422. hHuman.Health=hHuman.Health-dmg
  423. wait(.1)
  424. hit=false
  425. end
  426. end)
  427. end
  428. function rockHit(prt)
  429. prt.Touched:connect(function(h)
  430. if key==true and not hit and h.Parent~=player.Character then
  431. hit=true
  432. if h.Parent:findFirstChild("Humanoid") then
  433. local fakeM=Instance.new("Model", workspace)
  434. fakeM.Name=-dmg*mrand(2, 5.5)
  435. local hHuman=h.Parent:findFirstChild("Humanoid")
  436. local hTorso=h.Parent:findFirstChild("Torso")
  437. local fakeH=Instance.new("Humanoid", fakeM) fakeH.MaxHealth=0 fakeH.Health=0
  438. 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"
  439. c(function()
  440. local bv=Instance.new("BodyVelocity", label)
  441. bv.maxForce=Vector3.new(inf, inf, inf)
  442. bv.velocity=Vector3.new(0, 4.5, 0)
  443. Game.Debris:addItem(fakeM, 1)
  444. end)
  445. hHuman.Health=hHuman.Health-dmg
  446. end
  447. local e=Instance.new("Explosion", workspace)
  448. e.BlastPressure=2
  449. e.BlastRadius=4
  450. e.Position=h.Position
  451. prt:remove()
  452. wait()
  453. hit=false
  454. end
  455. end)
  456. end
  457. function makeCrater(cf, size)
  458. local to=cf.p-(cf.p+Vector3.new(0, 200, 0))
  459. local hit, pos=rayCast(cf.p, to)
  460. if hit and pos then
  461. for i=1, 3 do
  462. 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))))
  463. end
  464. end
  465. end
  466. function makeLightning(from, to, thick, col)
  467. local magnitude=(from.p-to.p).magnitude
  468. local distance=(from.p+to.p)/2
  469. local pattern=add.Part(workspace, true, false, "White", 1, Vector3.new(.2, .2, magnitude), cn(distance, from.p))
  470. local fromPosProx=from.p
  471. local lim=Instance.new("Model", workspace)
  472. for i=1, 4 do
  473. local fromPosProx2=fromPosProx
  474. local random=Vector3.new(mrand(-1, 1), mrand(-1, 1), mrand(-1, 1))
  475. local findSize=pattern.Size.z/4
  476. local findOffSet=pattern.CFrame.lookVector*-1
  477. local compute=i*findSize*findOffSet
  478. local newfromPos=from.p
  479. local newEndPos=cn(random+compute+newfromPos).p
  480. local magnitude=(fromPosProx2-newEndPos).magnitude
  481. local distance=(fromPosProx2+newEndPos)/2
  482. 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))
  483. fromPosProx=newEndPos
  484. game.Debris:addItem(lim, 1)
  485. end
  486. pattern:remove()
  487. end
  488. function makeCircle(prt ,dis, rep, angle)
  489. local cm=Instance.new("Model", prt.Parent)
  490. for i=angle*2/rep, angle*2 do
  491. local prt2=prt:clone()
  492. prt2.Parent=cm
  493. prt2.CFrame=prt.CFrame*cn(dis*ms(i), 0, dis*mc(i))
  494. end
  495. prt:remove()
  496. return cm
  497. end
  498. local bv=Instance.new("BodyVelocity") bv.maxForce=Vector3.new(inf, 0, inf)
  499. local bav=Instance.new("BodyAngularVelocity") bav.maxTorque=Vector3.new(inf, inf, inf)
  500. function startBoost()
  501. boost(obj.TS, 3, "Bright orange")
  502. while boosts do
  503. if speed<150 then
  504. speed=speed+2
  505. bv.velocity=obj.Frame.CFrame.lookVector*speed
  506. end
  507. wait()
  508. end
  509. end
  510. local fire=false
  511. function startMG()
  512. fire=true
  513. for i=0, 1, .1 do
  514. animate.MachineGunR(cn(4.5*i, 0, 0))
  515. animate.MachineGunL(cn(-4.5*i, 0, 0))
  516. wait()
  517. end
  518. while fire do
  519. local mb=add.Part(workspace, false, false, "Bright yellow", 0, Vector3.new(.2, .2, 1), obj.gr.CFrame+obj.gr.CFrame.lookVector)
  520. dmgHit(mb)
  521. local f=Instance.new("BodyForce", mb) f.force=Vector3.new(0, mb:getMass()*196.25, 0)
  522. local v=Instance.new("BodyVelocity", mb) v.maxForce=Vector3.new(inf, inf, inf) v.velocity=mb.CFrame.lookVector*200
  523. local ef=add.Part(workspace, false, false, "Bright yellow", .2, Vector3.new(1, .5, 1))
  524. local efm=add.Mesh("SpecialMesh", ef, Vector3.new(1, 1, 1), nil, Meshes.Crown)
  525. add.Weld(ef, obj.gr, cn(0, 0, -1)*ca(-pi/2, 0, 0))
  526. game.Debris:addItem(ef, .1)
  527. game.Debris:addItem(mb, 1.5)
  528.  
  529. local mb2=add.Part(workspace, false, false, "Bright yellow", 0, Vector3.new(.2, .2, 1), obj.gl.CFrame+obj.gl.CFrame.lookVector)
  530. dmgHit(mb2)
  531. local f=Instance.new("BodyForce", mb2) f.force=Vector3.new(0, mb2:getMass()*196.25, 0)
  532. local v=Instance.new("BodyVelocity", mb2) v.maxForce=Vector3.new(inf, inf, inf) v.velocity=mb2.CFrame.lookVector*200
  533. local ef=add.Part(workspace, false, false, "Bright yellow", .2, Vector3.new(1, .5, 1))
  534. local efm=add.Mesh("SpecialMesh", ef, Vector3.new(1, 1, 1), nil, Meshes.Crown)
  535. add.Weld(ef, obj.gl, cn(0, 0, -1)*ca(-pi/2, 0, 0))
  536. game.Debris:addItem(ef, .1)
  537. game.Debris:addItem(mb2, 1.5)
  538. wait(.1)
  539. end
  540. for i=1, 0, -.1 do
  541. animate.MachineGunR(cn(4.5*i, 0, 0))
  542. animate.MachineGunL(cn(-4.5*i, 0, 0))
  543. wait()
  544. end
  545. end
  546. function startRocket()
  547. for i=0, 1, .1 do
  548. animate.Rocket(cn(0, 0, -8*i))
  549. wait()
  550. end
  551. wait(.2)
  552. local mb=add.Part(workspace, false, false, "Bright yellow", 0, Vector3.new(1, 1, 2), obj.rock.CFrame+obj.rock.CFrame.lookVector*2)
  553. rockHit(mb)
  554. local f=Instance.new("BodyForce", mb) f.force=Vector3.new(0, mb:getMass()*196.25, 0)
  555. local v=Instance.new("BodyVelocity", mb) v.maxForce=Vector3.new(inf, inf, inf) v.velocity=mb.CFrame.lookVector*300
  556. local ef=add.Part(workspace, false, false, "Bright yellow", .2, Vector3.new(1, .5, 1))
  557. local efm=add.Mesh("SpecialMesh", ef, Vector3.new(1.5, 1.5, 1.5), nil, Meshes.Crown)
  558. add.Weld(ef, obj.rock, cn(0, 0, -.5)*ca(-pi/2, 0, 0))
  559. game.Debris:addItem(ef, .1)
  560. game.Debris:addItem(mb, 1.5)
  561. wait(.2)
  562. for i=1, 0, -.1 do
  563. animate.Rocket(cn(0, 0, -8*i))
  564. wait()
  565. end
  566. end
  567. function startSelfDestruct()
  568. obj.VCW:remove()
  569. obj.VC.CanCollide=false
  570. local p=Instance.new("BodyPosition", obj.VC) p.maxForce=Vector3.new(inf, inf, inf) p.position=obj.VC.Position+Vector3.new(0, 300, 0)
  571. wait(1)
  572. local e=Instance.new("Explosion", workspace)
  573. e.BlastPressure=500
  574. e.BlastRadius=500
  575. e.Position=obj.Frame.Position
  576. end
  577. local slice=false
  578. function startSlice()
  579. slice=true
  580. for i=0, 1, .1 do
  581. animate.BladeR(cn(5.5*i, 0, 0))
  582. animate.BladeL(cn(-5.5*i, 0, 0))
  583. wait()
  584. end
  585. sliceHit(obj.p1) sliceHit(obj.p2)
  586. sliceHit(obj.br) sliceHit(obj.bl)
  587. while slice do wait() end
  588. for i=1, 0, -.1 do
  589. animate.BladeR(cn(5.5*i, 0, 0))
  590. animate.BladeL(cn(-5.5*i, 0, 0))
  591. wait()
  592. end
  593. end
  594. local hover=false
  595. function startHover()
  596. bv.maxForce=Vector3.new(inf, inf, inf)
  597. for i=0, 1, .05 do
  598. animate.Wheel(ca(0, 0, mr(90*i)))
  599. animate.Wheel2(ca(0, 0, mr(-90*i)))
  600. animate.Wheel3(ca(0, 0, mr(90*i)))
  601. animate.Wheel4(ca(0, 0, mr(-90*i)))
  602. animate.Booster(ca(mr(90*i), 0, 0))
  603. bv.velocity=bv.velocity+Vector3.new(0, 10*i, 0)
  604. wait()
  605. end
  606. boost(obj.TS, 3, "Bright orange")
  607. bv.velocity=Vector3.new(0, 0, 0)
  608. 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
  609. for i=1, 0, -.05 do
  610. animate.Wheel(ca(0, 0, mr(90*i)))
  611. animate.Wheel2(ca(0, 0, mr(-90*i)))
  612. animate.Wheel3(ca(0, 0, mr(90*i)))
  613. animate.Wheel4(ca(0, 0, mr(-90*i)))
  614. animate.Booster(ca(mr(90*i), 0, 0))
  615. bv.velocity=bv.velocity-Vector3.new(0, 5-5*i, 0)
  616. wait()
  617. end
  618. bv.maxForce=Vector3.new(inf, 0, inf)
  619. boosts=false
  620. end
  621. function KeyDown(k)
  622. if k=="b" and not key and not boosts then
  623. key=true
  624. startBoost()
  625. end
  626. if k=="x" and not hover then
  627. hover=true
  628. startHover()
  629. elseif k=="x" and hover then
  630. hover=false
  631. end
  632. if k=="c" and not key and not slice then
  633. key=true
  634. startSlice()
  635. end
  636. if k=="r" and not key then
  637. key=true
  638. startRocket()
  639. key=false
  640. end
  641. if k=="g" and not key then
  642. key=true
  643. startSelfDestruct()
  644. key=false
  645. end
  646. if k=="f" and not key and not fire then
  647. key=true
  648. startMG()
  649. end
  650. if k=="v" and not key then
  651. key=true
  652. speed=0
  653. key=false
  654. end
  655. end
  656. function KeyUp(k)
  657. if k=="b" and boosts and key then
  658. key=false
  659. boosts=false
  660. end
  661. if k=="f" and fire and key then
  662. key=false
  663. fire=false
  664. end
  665. if k=="c" and slice and key then
  666. key=false
  667. slice=false
  668. end
  669. end
  670. local engine=false
  671. createParts()
  672. obj.VC.ChildAdded:connect(function(ad)
  673. if ad.Name=="SeatWeld" then
  674. torso=ad.Part1
  675. local vc=obj.VC
  676. if torso then print("Found")
  677. player=game.Players:getPlayerFromCharacter(torso.Parent)
  678. mouse=player:GetMouse()
  679. ad.C1=ad.C1*CFrame.new(0, 0, 1.5)
  680. bv.Parent=obj.Frame
  681. bav.Parent=obj.Frame
  682. gui.Parent=player.PlayerGui
  683. mouse.KeyDown:connect(KeyDown)
  684. mouse.KeyUp:connect(KeyUp)
  685. engine=true
  686. while torso and vc and engine do print("working")
  687. obj.AL.Text="Speed("..speed..")"
  688. if vc.Throttle==1 and speed<100 then
  689. speed=speed+1
  690. bv.velocity=obj.Frame.CFrame.lookVector*speed
  691. end
  692. if vc.Throttle==-1 and speed>-100 then
  693. speed=speed-1
  694. bv.velocity=obj.Frame.CFrame.lookVector*speed
  695. end
  696. if vc.Throttle==0 and speed>0 then
  697. speed=speed-1
  698. bv.velocity=obj.Frame.CFrame.lookVector*speed
  699. end
  700. if vc.Throttle==0 and speed<0 then
  701. speed=speed+1
  702. bv.velocity=obj.Frame.CFrame.lookVector*speed
  703. end
  704. if vc.Steer==1 then
  705. bav.angularvelocity=Vector3.new(0, -2, 0)
  706. if not hover then
  707. animate.Wheel2(ca(mr(-25), 0, 0))
  708. animate.Wheel(ca(mr(-25), 0, 0))
  709. end
  710. end
  711. if vc.Steer==-1 then
  712. bav.angularvelocity=Vector3.new(0, 2, 0)
  713. if not hover then
  714. animate.Wheel2(ca(mr(25), 0, 0))
  715. animate.Wheel(ca(mr(25), 0, 0))
  716. end
  717. end
  718. if vc.Steer==0 then
  719. bav.angularvelocity=Vector3.new(0, 0, 0)
  720. if not hover then
  721. animate.Wheel2(ca(0, 0, 0))
  722. animate.Wheel(ca(0, 0, 0))
  723. end
  724. end
  725. wait()
  726. end
  727. end
  728. end
  729. end)
  730. obj.VC.ChildRemoved:connect(function()
  731. bv.Parent=nil bav.Parent=nil gui.Parent=nil engine=false
  732. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement