Advertisement
thetacolord609

Untitled

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