TheProNoob2004

Mantis

Jun 19th, 2016
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 47.34 KB | None | 0 0
  1.  
  2. _G.mantisReload = function()
  3.  
  4. local plr = game:service'Players'.LocalPlayer
  5. local pg = plr:WaitForChild("PlayerGui")
  6. local mouse = plr:GetMouse()
  7. local char = plr.Character
  8. local root = char:WaitForChild'HumanoidRootPart'
  9. local head = char:WaitForChild'Head'
  10. local tor = char:WaitForChild'Torso'
  11. local la,ra = char["Left Arm"],char["Right Arm"]
  12. local ll,rl = char["Left Leg"],char["Right Leg"]
  13. tor.CFrame = tor.CFrame + Vector3.new(0,5,0)
  14.  
  15. local hum = char.Humanoid
  16. local step = game:GetService("RunService").RenderStepped
  17.  
  18. pcall(function() workspace["vmodel"..plr.Name]:Destroy() end)
  19. pcall(function() pg.bgui:Destroy() end)
  20. if not script:IsA("ModuleScript") then
  21. pcall(function() script.Parent.vehicularScript:Destroy() end)
  22. script.Name = "vehicularScript"
  23. end
  24.  
  25. local sg = Instance.new("ScreenGui",pg)
  26. sg.Name = "bgui"
  27. local p = Instance.new("ImageLabel",sg)
  28. p.Size = UDim2.new(0,6,0,6)
  29. p.Position = UDim2.new(.5,-3,.5,-3)
  30. p.BackgroundColor3 = Color3.new(1,1,1)
  31. p.BackgroundTransparency = .6
  32. local p2 = p:Clone()
  33. p2.Parent = sg
  34. p2.Rotation = 45
  35. local m = Instance.new("Model",workspace)
  36. m.Name = "vmodel"..plr.Name
  37. Instance.new("Humanoid",m).Name = "Shadow"
  38. local hval = Instance.new("NumberValue",m)
  39. hval.Value = 100
  40. hval.Name = "hp"
  41.  
  42. function weld(a,b,c,d)
  43. local w = Instance.new("Motor6D",a)
  44. w.Part0,w.Part1,w.C0,w.C1 = a,b,c or CFrame.new(),d or CFrame.new()
  45. return w
  46. end
  47.  
  48. do
  49. local function QuaternionFromCFrame(cf)
  50. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  51. local trace = m00 + m11 + m22
  52. if trace > 0 then
  53. local s = math.sqrt(1 + trace)
  54. local recip = 0.5/s
  55. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  56. else
  57. local i = 0
  58. if m11 > m00 then
  59. i = 1
  60. end
  61. if m22 > (i == 0 and m00 or m11) then
  62. i = 2
  63. end
  64. if i == 0 then
  65. local s = math.sqrt(m00-m11-m22+1)
  66. local recip = 0.5/s
  67. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  68. elseif i == 1 then
  69. local s = math.sqrt(m11-m22-m00+1)
  70. local recip = 0.5/s
  71. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  72. elseif i == 2 then
  73. local s = math.sqrt(m22-m00-m11+1)
  74. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  75. end
  76. end
  77. end
  78. local function QuaternionToCFrame(px, py, pz, x, y, z, w)
  79. local xs, ys, zs = x + x, y + y, z + z
  80. local wx, wy, wz = w*xs, w*ys, w*zs
  81. local xx = x*xs
  82. local xy = x*ys
  83. local xz = x*zs
  84. local yy = y*ys
  85. local yz = y*zs
  86. local zz = z*zs
  87. return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
  88. end
  89. local function QuaternionSlerp(a, b, t)
  90. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  91. local startInterp, finishInterp;
  92. if cosTheta >= 0.0001 then
  93. if (1 - cosTheta) > 0.0001 then
  94. local theta = math.acos(cosTheta)
  95. local invSinTheta = 1/math.sin(theta)
  96. startInterp = math.sin((1-t)*theta)*invSinTheta
  97. finishInterp = math.sin(t*theta)*invSinTheta
  98. else
  99. startInterp = 1-t
  100. finishInterp = t
  101. end
  102. else
  103. if (1+cosTheta) > 0.0001 then
  104. local theta = math.acos(-cosTheta)
  105. local invSinTheta = 1/math.sin(theta)
  106. startInterp = math.sin((t-1)*theta)*invSinTheta
  107. finishInterp = math.sin(t*theta)*invSinTheta
  108. else
  109. startInterp = t-1
  110. finishInterp = t
  111. end
  112. end
  113. return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
  114. end
  115. function clerp(a,b,t)
  116. local qa = {QuaternionFromCFrame(a)}
  117. local qb = {QuaternionFromCFrame(b)}
  118. local ax, ay, az = a.x, a.y, a.z
  119. local bx, by, bz = b.x, b.y, b.z
  120. local _t = 1-t
  121. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  122. end
  123. end
  124.  
  125. function lerp(a,b,t)
  126. return a+(b-a)*t
  127. end
  128.  
  129. local cancollide = true
  130. local par = m
  131. function Part(Part0,C0,C1,Size,Color,Ref,Trans,Mesh,Material)
  132. local p = Instance.new("Part",par)
  133. p.FormFactor = "Custom"
  134. p.TopSurface,p.BottomSurface,p.BackSurface,p.FrontSurface,p.RightSurface,p.LeftSurface = 10,10,10,10,10,10
  135. p.Size = Size or Vector3.new()
  136. p.Material = "SmoothPlastic"
  137. p.CanCollide = cancollide
  138. p.Locked = true
  139. if p.Size ~= Size or Mesh then
  140. local bm = Mesh or Instance.new("BlockMesh")
  141. bm.Parent = p
  142. bm.Scale = Size/p.Size*bm.Scale
  143. bm.Parent = p
  144. end
  145. p.BrickColor = Color or BrickColor.new(1001)
  146. p.Reflectance = Ref or 0
  147. p.Transparency = Trans or 0
  148. p.Material = Material or p.Material
  149. local w;
  150. if Part0 then
  151. w = weld(Part0,p,C0,C1)
  152. end
  153. return p,w
  154. end
  155.  
  156. function Mesh(type,scale,arg1,arg2,arg3,arg4,arg5)
  157. local m = Instance.new(type)
  158. m.Scale = scale or Vector3.new(1,1,1)
  159. if type == "SpecialMesh" then
  160. m.MeshType = arg1
  161. if arg1=="FileMesh" then
  162. m.MeshId = arg2 or m.MeshId
  163. m.TextureId = arg3 or m.TextureId
  164. m.Offset = arg4 or m.Offset
  165. m.VertexColor = arg5 or m.VertexColor
  166. else
  167. m.VertexColor = arg3 or m.VertexColor
  168. m.Offset = arg2 or m.Offset
  169. end
  170. else
  171. m.Offset = arg1 or m.Offset
  172. m.VertexColor = arg2 or m.VertexColor
  173. end
  174. return m
  175. end
  176.  
  177. local b = BrickColor.new
  178. local cols = {b(21),b(23),b(141),b(104),b(106),b(24),b(9),b(5)}
  179. function gcol(plr)
  180. if teamColorsEnabled and pcall(function() assert(plr.AccountAge ~= nil) end) and not plr.Neutral then
  181. return plr.TeamColor.Color
  182. else
  183. local v=0;
  184. local n=tostring(plr);
  185. local a=#n;
  186. for i in n:gmatch(".") do
  187. v = v + ((a+(#n%2==1 and -1 or 0))%4 > 1 and -1 or 1)*i:byte()
  188. a = a - 1
  189. end
  190. return cols[(v%8)+1].Color
  191. end
  192. end
  193.  
  194.  
  195. local body = BrickColor.new("Really black")
  196. local body2 = BrickColor.new("Institutional white")
  197. local body3 = BrickColor.new("Really black")
  198. local bodyref = .2
  199. local body2ref = .2
  200. local body3ref = .5
  201.  
  202. local pipe = BrickColor.new("Dark stone grey")
  203. local pipe2 = body2--BrickColor.new("Institutional white")
  204. local pipe3 = body--BrickColor.new("Really black")
  205. local piperef = .25
  206. local pipe2ref = .2
  207. local pipe3ref = .25
  208.  
  209. hum.Sit = true
  210.  
  211.  
  212. local fc = Instance.new("Model",m)
  213. par = fc
  214. local tr = Part(tor,CFrame.new(),CFrame.new(),Vector3.new(),BrickColor.new(),0,1)
  215. tr.Name = "Torso"
  216. Part(tr,CFrame.new(),CFrame.new(),Vector3.new(),BrickColor.new(),0,1).Name = "Head"
  217. Part(ra,CFrame.new(),CFrame.new(),Vector3.new(),ra.BrickColor,0,0).Name = "Right Arm"
  218. Part(la,CFrame.new(),CFrame.new(),Vector3.new(),la.BrickColor,0,0).Name = "Left Arm"
  219. Part(rl,CFrame.new(),CFrame.new(),Vector3.new(),rl.BrickColor,0,0).Name = "Right Leg"
  220. Part(ll,CFrame.new(),CFrame.new(),Vector3.new(),ll.BrickColor,0,0).Name = "Left Leg"
  221. local hm = Instance.new("Humanoid",fc)
  222. hm.MaxHealth = math.huge
  223. hm.PlatformStand = true
  224. for i,v in pairs(char:GetChildren()) do
  225. if v:IsA("Clothing") or v:IsA("CharacterMesh") then
  226. v:Clone().Parent = fc
  227. if v:IsA("Shirt") then
  228. pcall(game.Destroy,tr:FindFirstChild("Mesh"))
  229. pcall(game.Destroy,fc["Right Arm"]:FindFirstChild("Mesh"))
  230. pcall(game.Destroy,fc["Left Arm"]:FindFirstChild("Mesh"))
  231. elseif v:IsA("Pants") then
  232. pcall(game.Destroy,tr:FindFirstChild("Mesh"))
  233. pcall(game.Destroy,fc["Right Leg"]:FindFirstChild("Mesh"))
  234. pcall(game.Destroy,fc["Left Leg"]:FindFirstChild("Mesh"))
  235. end
  236. end
  237. end
  238. local h = Instance.new("Hat",fc)
  239. par = h
  240. Part(tr,CFrame.new(),CFrame.new(),Vector3.new(),BrickColor.new(),0,1).Name = "Handle"
  241. par = m
  242.  
  243. local main,mainweld = Part(tor,CFrame.new(0,-2.25,0)*CFrame.Angles(0,0,0),CFrame.new(0,0,0),Vector3.new(3,1,2),body,bodyref,0)
  244. Part(main,CFrame.new(0,.5,-.4),CFrame.new(),Vector3.new(2.3,.2,1.3),body2,0,0)
  245. local p = Part(main,CFrame.new(0,-.5,1)*CFrame.Angles(-1.4,0,0)*CFrame.new(0,.5,1.25),CFrame.new(),Vector3.new(2.3,.75,2.5),body,bodyref)
  246. Part(p,CFrame.new(0,.375,0),CFrame.new(),Vector3.new(2.2,.2,1.4),body2,0,0)
  247. p = Part(p,CFrame.new(0,-.375,1.25)*CFrame.Angles(-.15,0,0)*CFrame.new(0,.375,.8),CFrame.new(),Vector3.new(2.3,.75,1.6),body,bodyref)
  248. p.CanCollide = false
  249. Part(p,CFrame.new(0,.375,0),CFrame.new(),Vector3.new(2.2,.2,1.2),body2,0,0).CanCollide = false
  250. local back = Part(main,CFrame.new(0,1.4,1)*CFrame.Angles(.15,math.pi,0),CFrame.new(),Vector3.new(2,2,3),body,bodyref,0,Mesh("SpecialMesh",Vector3.new(3,3.8,6.5),"FileMesh","rbxassetid://9944765"))
  251. Part(main,CFrame.new(0,-.5,1.75)*CFrame.Angles(-1.1,0,0)*CFrame.new(0,.5,1.25),CFrame.new(),Vector3.new(1.75,1.5,2.25),body,bodyref)
  252. Part(main,CFrame.new(0,0,1.25),CFrame.new(),Vector3.new(1.75,1.1,1.5),body,bodyref)
  253. local p = Part(main,CFrame.new(0,.5,-1)*CFrame.Angles(-.2,0,0)*CFrame.new(0,-.375,-.5),CFrame.new(),Vector3.new(2.75,.75,1),body,bodyref)
  254. Part(p,CFrame.new(0,.375,.05),CFrame.new(),Vector3.new(2.3,.2,.95),body2,0,0)
  255. Part(p,CFrame.new(0,.8,-.45),CFrame.new(),Vector3.new(2.3,1,.3),body2,0,0)
  256. Part(p,CFrame.new(0,1.5,-.4)*CFrame.Angles(.2,0,0),CFrame.new(),Vector3.new(2.3,.5,.3),body2,0,0)
  257. local p = Part(main,CFrame.new(0,2.1,-2.9)*CFrame.Angles(.9,0,0),CFrame.new(),Vector3.new(1.5,2.5,1),body,bodyref,0)
  258. local p = Part(p,CFrame.new(0,1.25,.5)*CFrame.Angles(-.9,0,0)*CFrame.new(0,.5,-.7),CFrame.new(),Vector3.new(1.501,1,1.4),body,bodyref,0)
  259. local h = Part(p,CFrame.new(.4,-.2,.7)*CFrame.Angles(0,1.425,0)*CFrame.new(.175,0,.9),CFrame.new(),Vector3.new(.35,.35,1.8),body,bodyref,0)
  260. Part(h,CFrame.new(0,0,.225),CFrame.new(),Vector3.new(.4,.4,1.3),body2,body2ref,0)
  261. Part(h,CFrame.new(0,0,.9),CFrame.new(),Vector3.new(.45,.45,.1),body3,body3ref,0)
  262. Part(h,CFrame.new(0,0,-.45),CFrame.new(),Vector3.new(.425,.425,.1),body3,body3ref,0)
  263. Part(h,CFrame.new(0,0,.75),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  264. Part(h,CFrame.new(0,0,.6),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  265. Part(h,CFrame.new(0,0,.45),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  266. Part(h,CFrame.new(0,0,.3),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  267. Part(h,CFrame.new(0,0,.15),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  268. Part(h,CFrame.new(0,0,0),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  269. Part(h,CFrame.new(0,0,-.15),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  270. Part(h,CFrame.new(0,0,-.3),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  271. local h = Part(p,CFrame.new(-.4,-.2,.7)*CFrame.Angles(0,-1.425,0)*CFrame.new(-.175,0,.9),CFrame.new(),Vector3.new(.35,.35,1.8),body,bodyref,0)
  272. Part(h,CFrame.new(0,0,.225),CFrame.new(),Vector3.new(.4,.4,1.3),body2,body2ref,0)
  273. Part(h,CFrame.new(0,0,.9),CFrame.new(),Vector3.new(.45,.45,.1),body3,body3ref,0)
  274. Part(h,CFrame.new(0,0,-.45),CFrame.new(),Vector3.new(.425,.425,.1),body3,body3ref,0)
  275. Part(h,CFrame.new(0,0,.75),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  276. Part(h,CFrame.new(0,0,.6),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  277. Part(h,CFrame.new(0,0,.45),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  278. Part(h,CFrame.new(0,0,.3),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  279. Part(h,CFrame.new(0,0,.15),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  280. Part(h,CFrame.new(0,0,0),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  281. Part(h,CFrame.new(0,0,-.15),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  282. Part(h,CFrame.new(0,0,-.3),CFrame.new(),Vector3.new(.415,.415,.025),body3,body3ref,0)
  283.  
  284. local e = Part(main,CFrame.new(0,1,-4.6)*CFrame.Angles(-.2,-math.pi/2,0)*CFrame.new(0,-.2,0),CFrame.new(),Vector3.new(5,5,5),body,bodyref,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  285. p = Part(e,CFrame.new(-2.25,2.25,0)*CFrame.Angles(0,-math.pi/2,0)*CFrame.Angles(-.05,0,0),CFrame.new(),Vector3.new(2,2,3),body,bodyref,0,Mesh("SpecialMesh",Vector3.new(2,1.75,9.5),"FileMesh","rbxassetid://9944765"))
  286. p = Part(p,CFrame.new(0,-.2,.4)*CFrame.Angles(0,0,0)*CFrame.Angles(-.175,0,0),CFrame.new(),Vector3.new(1,1,1),body2,body2ref,0,Mesh("SpecialMesh",Vector3.new(2.3,2.3,2),"FileMesh","rbxassetid://9944765"))
  287.  
  288. p = Part(e,CFrame.new(2,.25,2)*CFrame.Angles(1.35,math.pi/2,0)*CFrame.Angles(0,0,0),CFrame.new(),Vector3.new(2,2,3),body,bodyref,0,Mesh("SpecialMesh",Vector3.new(2.5,2.5,9.5),"FileMesh","rbxassetid://9944765"))
  289. p = Part(p,CFrame.new(0,.2,-4.55)*CFrame.Angles(0,math.pi,-.1),CFrame.new(),Vector3.new(1,1,1),body,bodyref,0,Mesh("SpecialMesh",Vector3.new(1.6,1.1,9),"FileMesh","rbxassetid://9944765"))
  290.  
  291. p = Part(e,CFrame.new(2,.25,-2)*CFrame.Angles(-1.35,math.pi/2,0)*CFrame.Angles(0,0,0),CFrame.new(),Vector3.new(2,2,3),body,bodyref,0,Mesh("SpecialMesh",Vector3.new(2.5,2.5,9.5),"FileMesh","rbxassetid://9944765"))
  292. p = Part(p,CFrame.new(0,.2,-4.55)*CFrame.Angles(0,math.pi,-.1),CFrame.new(),Vector3.new(1,1,1),body,bodyref,0,Mesh("SpecialMesh",Vector3.new(1.6,1.1,9),"FileMesh","rbxassetid://9944765"))
  293.  
  294.  
  295.  
  296. local e2 = Part(e,CFrame.new(-2.5,0,0)*CFrame.Angles(0,math.pi/2,0),CFrame.new(),Vector3.new(5,5,1),body,bodyref,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Sphere"))
  297. local et = Part(e2,CFrame.new(0,.05,-.6)*CFrame.Angles(-math.pi/2+.05,0,0),CFrame.new(),Vector3.new(5,5,1),body,bodyref,0,Mesh("SpecialMesh",Vector3.new(3.45,5,3.45),"FileMesh","rbxassetid://16659502"))
  298. local g1 = Part(et,CFrame.new(0,-.5,0)*CFrame.Angles(math.pi/2,0,0),CFrame.new(),Vector3.new(2.5,2.5,2.5),body2,body2ref,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Sphere"))
  299. local g2 = Part(g1,CFrame.new(0,0,-1)*CFrame.Angles(.15,math.pi/2,0),CFrame.new(),Vector3.new(.75,.6,.6),body2,body2ref,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  300. local t1 = Part(g2,CFrame.new(.9,.05,0)*CFrame.Angles(0,0,0),CFrame.new(),Vector3.new(1,.4,.4),body3,body3ref,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  301. local t1s = Instance.new("Sound",t1)
  302. t1s.SoundId = "rbxassetid://78498351"
  303. t1s.Volume = 0.5
  304. t1s.Pitch = 1.5
  305.  
  306. Part(t1,CFrame.Angles(.75,0,0)*CFrame.new(.3,.2,0)*CFrame.Angles(0,0,math.pi/2),CFrame.new(),Vector3.new(.025,.15,.15),BrickColor.new(1003),0,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  307. Part(t1,CFrame.Angles(.75,0,0)*CFrame.new(0,.2,0)*CFrame.Angles(0,0,math.pi/2),CFrame.new(),Vector3.new(.025,.15,.15),BrickColor.new(1003),0,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  308. Part(t1,CFrame.Angles(.75,0,0)*CFrame.new(-.3,.2,0)*CFrame.Angles(0,0,math.pi/2),CFrame.new(),Vector3.new(.025,.15,.15),BrickColor.new(1003),0,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  309. Part(t1,CFrame.Angles(-.75,0,0)*CFrame.new(.3,.2,0)*CFrame.Angles(0,0,math.pi/2),CFrame.new(),Vector3.new(.025,.15,.15),BrickColor.new(1003),0,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  310. Part(t1,CFrame.Angles(-.75,0,0)*CFrame.new(0,.2,0)*CFrame.Angles(0,0,math.pi/2),CFrame.new(),Vector3.new(.025,.15,.15),BrickColor.new(1003),0,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  311. Part(t1,CFrame.Angles(-.75,0,0)*CFrame.new(-.3,.2,0)*CFrame.Angles(0,0,math.pi/2),CFrame.new(),Vector3.new(.025,.15,.15),BrickColor.new(1003),0,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  312. Part(t1,CFrame.new(.5,0,0),CFrame.new(),Vector3.new(.01,.225,.225),BrickColor.new(1003),0,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  313.  
  314. local b = Part(main,CFrame.new(0,-.65,-2.9),CFrame.new(),Vector3.new(2.8,2,7.9),body,bodyref,0)
  315. local b2 = Part(b,CFrame.new(0,-.5,-2.5),CFrame.new(),Vector3.new(7,1,2),body,bodyref,0)
  316.  
  317. local w = Part(b2,CFrame.new(-3.5,0,0),CFrame.new(),Vector3.new(1.2,1.05,2),body,bodyref,0)
  318. local w = Part(w,CFrame.new(.6,0,-1)*CFrame.Angles(0,.5,0)*CFrame.new(-.6,0,-1),CFrame.new(),Vector3.new(1.2,1.049,2),body,bodyref,0)
  319. Part(w,CFrame.new(.6,0,0),CFrame.new(),Vector3.new(.5,1.1,2.07),body2,body2ref,0)
  320. local w = Part(w,CFrame.new(.6,0,-1)*CFrame.Angles(0,.5,0)*CFrame.new(-.6,0,-.95),CFrame.new(),Vector3.new(1.2,1.05,1.9),body,bodyref,0)
  321. Part(w,CFrame.new(.6,0,0),CFrame.new(),Vector3.new(.5,1.095,2.05),body2,body2ref,0)
  322. local w = Part(w,CFrame.new(.6,0,-.95)*CFrame.Angles(0,.57,0)*CFrame.new(-.65,0,-1.2),CFrame.new(),Vector3.new(1.3,1.049,2.4),body,bodyref,0)
  323. Part(w,CFrame.new(.65,0,.8),CFrame.new(),Vector3.new(.5,1.1,.95),body2,body2ref,0)
  324. local w = Part(w,CFrame.new(-.6,0,-1.2)*CFrame.Angles(0,-1.57,0)*CFrame.new(.8,0,-1.25),CFrame.new(),Vector3.new(1.6,1.05,2.5),body,bodyref,0)
  325. local w = Part(w,CFrame.new(-.8,0,-1.25)*CFrame.Angles(0,-.4,0)*CFrame.new(.7,0,1.25),CFrame.new(),Vector3.new(1.4,1.049,2.5),body,bodyref,0)
  326. local w = Part(w,CFrame.new(.7,0,1.25)*CFrame.Angles(0,-.45,0)*CFrame.new(-.7,0,1),CFrame.new(),Vector3.new(1.4,1.05,2),body,bodyref,0)
  327. local w = Part(w,CFrame.new(-.7,0,1)*CFrame.Angles(0,.6,0)*CFrame.new(.7,0,1),CFrame.new(),Vector3.new(1.4,1.049,2),body,bodyref,0)
  328. local w = Part(w,CFrame.new(-.7,0,1)*CFrame.Angles(0,.55,0)*CFrame.new(.7,0,1),CFrame.new(),Vector3.new(1.4,1.05,2),body,bodyref,0)
  329. local w = Part(w,CFrame.new(-.7,0,1)*CFrame.Angles(0,.5,0)*CFrame.new(.7,0,1),CFrame.new(),Vector3.new(1.4,1.049,2),body,bodyref,0)
  330. local w = Part(w,CFrame.new(-.7,0,1)*CFrame.Angles(0,.45,0)*CFrame.new(.6,0,.5),CFrame.new(),Vector3.new(1.5,1.05,1),body,bodyref,0)
  331. local w = Part(w,CFrame.new(-.75,0,.5)*CFrame.Angles(0,.325,0)*CFrame.new(.5,0,1.3),CFrame.new(),Vector3.new(1.6,1.049,2.6),body,bodyref,0)
  332. local w = Part(w,CFrame.new(-.2,0,1.3)*CFrame.Angles(0,.65,0)*CFrame.new(.5,0,.8),CFrame.new(),Vector3.new(1,1.05,1.6),body,bodyref,0)
  333. local w = Part(w,CFrame.new(-.5,0,.8)*CFrame.Angles(0,.45,0)*CFrame.new(.5,0,1),CFrame.new(),Vector3.new(1,1.05,2),body,bodyref,0)
  334.  
  335.  
  336. cancollide = false
  337. Part(b2,CFrame.new(-3.5-3,.125,0)*CFrame.Angles(-math.pi/2,0,0),CFrame.new(),Vector3.new(3,3,1),body2,body2ref,0,Mesh("SpecialMesh",Vector3.new(5,5,6),"FileMesh","rbxassetid://3270017"),"DiamondPlate")
  338. Part(b2,CFrame.new(-3.5-3,-.125,0)*CFrame.Angles(-math.pi/2,0,0),CFrame.new(),Vector3.new(3,3,1),body2,body2ref,0,Mesh("SpecialMesh",Vector3.new(5,5,6),"FileMesh","rbxassetid://3270017"))
  339. cancollide = true
  340.  
  341. local propl,proplw = Part(b2,CFrame.new(-6.5,0,0),CFrame.new(),Vector3.new(.4,.75,.4),body2,body2ref,0,Mesh("CylinderMesh",Vector3.new(1,1,1)),"DiamondPlate")
  342. Part(propl,CFrame.new(0,.35,0),CFrame.new(),Vector3.new(.6,.25,.6),body3,body3ref,0,Mesh("CylinderMesh",Vector3.new(1,1,1)),"DiamondPlate")
  343. Part(propl,CFrame.new(0,-.35,0),CFrame.new(),Vector3.new(.5,.15,.5),body3,body3ref,0,Mesh("CylinderMesh",Vector3.new(1,1,1)),"DiamondPlate")
  344. Part(propl,CFrame.Angles(0,0*math.pi*2/3,0)*CFrame.new(0,0,.3),CFrame.new(),Vector3.new(.15,.65,.3),body3,body3ref,0,nil,"DiamondPlate")
  345. Part(propl,CFrame.Angles(0,1*math.pi*2/3,0)*CFrame.new(0,0,.3),CFrame.new(),Vector3.new(.15,.65,.3),body3,body3ref,0,nil,"DiamondPlate")
  346. Part(propl,CFrame.Angles(0,2*math.pi*2/3,0)*CFrame.new(0,0,.3),CFrame.new(),Vector3.new(.15,.65,.3),body3,body3ref,0,nil,"DiamondPlate")
  347. propl.Name = "SoundPlayer1"
  348. local ps2 = Instance.new("Sound",propl)
  349. ps2.SoundId = "rbxassetid://134145308"
  350. ps2.Pitch = 2
  351. ps2.Volume = 1
  352. ps2.Looped = true
  353. ps2:Play()
  354.  
  355.  
  356. local p = Part(propl,CFrame.Angles(0,0*math.pi*2/3,0)*CFrame.new(0,0,.35+.8)*CFrame.Angles(0,0,-1.3),CFrame.new(),Vector3.new(.05,.5,1.7),body2,body2ref,0,nil,"Plastic")
  357. Part(p,CFrame.Angles(0,0,1.3)*CFrame.new(-.125,0,.85),CFrame.new(),Vector3.new(.7,.25,.05),body2,body2ref,0,nil,"Plastic")
  358. local p = Part(propl,CFrame.Angles(0,1*math.pi*2/3,0)*CFrame.new(0,0,.35+.8)*CFrame.Angles(0,0,-1.3),CFrame.new(),Vector3.new(.05,.5,1.7),body2,body2ref,0,nil,"Plastic")
  359. Part(p,CFrame.Angles(0,0,1.3)*CFrame.new(-.125,0,.85),CFrame.new(),Vector3.new(.7,.25,.05),body2,body2ref,0,nil,"Plastic")
  360. local p = Part(propl,CFrame.Angles(0,2*math.pi*2/3,0)*CFrame.new(0,0,.35+.8)*CFrame.Angles(0,0,-1.3),CFrame.new(),Vector3.new(.05,.5,1.7),body2,body2ref,0,nil,"Plastic")
  361. Part(p,CFrame.Angles(0,0,1.3)*CFrame.new(-.125,0,.85),CFrame.new(),Vector3.new(.7,.25,.05),body2,body2ref,0,nil,"Plastic")
  362.  
  363.  
  364. local w = Part(b2,CFrame.new(3.5,0,0),CFrame.new(),Vector3.new(1.2,1.05,2),body,bodyref,0)
  365. local w = Part(w,CFrame.new(-.6,0,-1)*CFrame.Angles(0,-.5,0)*CFrame.new(.6,0,-1),CFrame.new(),Vector3.new(1.2,1.049,2),body,bodyref,0)
  366. Part(w,CFrame.new(-.6,0,0),CFrame.new(),Vector3.new(.5,1.1,2.07),body2,body2ref,0)
  367. local w = Part(w,CFrame.new(-.6,0,-1)*CFrame.Angles(0,-.5,0)*CFrame.new(.6,0,-.95),CFrame.new(),Vector3.new(1.2,1.05,1.9),body,bodyref,0)
  368. Part(w,CFrame.new(-.6,0,0),CFrame.new(),Vector3.new(.5,1.095,2.05),body2,body2ref,0)
  369. local w = Part(w,CFrame.new(-.6,0,-.95)*CFrame.Angles(0,-.57,0)*CFrame.new(.65,0,-1.2),CFrame.new(),Vector3.new(1.3,1.049,2.4),body,bodyref,0)
  370. Part(w,CFrame.new(-.65,0,.8),CFrame.new(),Vector3.new(.5,1.1,.95),body2,body2ref,0)
  371. local w = Part(w,CFrame.new(.6,0,-1.2)*CFrame.Angles(0,1.57,0)*CFrame.new(-.8,0,-1.25),CFrame.new(),Vector3.new(1.6,1.05,2.5),body,bodyref,0)
  372. local w = Part(w,CFrame.new(.8,0,-1.25)*CFrame.Angles(0,.4,0)*CFrame.new(-.7,0,1.25),CFrame.new(),Vector3.new(1.4,1.049,2.5),body,bodyref,0)
  373. local w = Part(w,CFrame.new(-.7,0,1.25)*CFrame.Angles(0,.45,0)*CFrame.new(.7,0,1),CFrame.new(),Vector3.new(1.4,1.05,2),body,bodyref,0)
  374. local w = Part(w,CFrame.new(.7,0,1)*CFrame.Angles(0,-.6,0)*CFrame.new(-.7,0,1),CFrame.new(),Vector3.new(1.4,1.049,2),body,bodyref,0)
  375. local w = Part(w,CFrame.new(.7,0,1)*CFrame.Angles(0,-.55,0)*CFrame.new(-.7,0,1),CFrame.new(),Vector3.new(1.4,1.05,2),body,bodyref,0)
  376. local w = Part(w,CFrame.new(.7,0,1)*CFrame.Angles(0,-.5,0)*CFrame.new(-.7,0,1),CFrame.new(),Vector3.new(1.4,1.049,2),body,bodyref,0)
  377. local w = Part(w,CFrame.new(.7,0,1)*CFrame.Angles(0,-.45,0)*CFrame.new(-.6,0,.5),CFrame.new(),Vector3.new(1.5,1.05,1),body,bodyref,0)
  378. local w = Part(w,CFrame.new(.75,0,.5)*CFrame.Angles(0,-.325,0)*CFrame.new(-.5,0,1.3),CFrame.new(),Vector3.new(1.6,1.049,2.6),body,bodyref,0)
  379. local w = Part(w,CFrame.new(.2,0,1.3)*CFrame.Angles(0,-.65,0)*CFrame.new(-.5,0,.8),CFrame.new(),Vector3.new(1,1.05,1.6),body,bodyref,0)
  380. local w = Part(w,CFrame.new(.5,0,.8)*CFrame.Angles(0,-.45,0)*CFrame.new(-.5,0,1),CFrame.new(),Vector3.new(1,1.05,2),body,bodyref,0)
  381.  
  382.  
  383. cancollide = false
  384. Part(b2,CFrame.new(3.5+3,.125,0)*CFrame.Angles(-math.pi/2,0,0),CFrame.new(),Vector3.new(3,3,1),body2,body2ref,0,Mesh("SpecialMesh",Vector3.new(5,5,6),"FileMesh","rbxassetid://3270017"),"DiamondPlate")
  385. Part(b2,CFrame.new(3.5+3,-.125,0)*CFrame.Angles(-math.pi/2,0,0),CFrame.new(),Vector3.new(3,3,1),body2,body2ref,0,Mesh("SpecialMesh",Vector3.new(5,5,6),"FileMesh","rbxassetid://3270017"))
  386. cancollide = true
  387.  
  388. local propr,proprw = Part(b2,CFrame.new(6.5,0,0),CFrame.new(),Vector3.new(.4,.75,.4),body2,body2ref,0,Mesh("CylinderMesh",Vector3.new(1,1,1)),"DiamondPlate")
  389. Part(propr,CFrame.new(0,.35,0),CFrame.new(),Vector3.new(.6,.25,.6),body3,body3ref,0,Mesh("CylinderMesh",Vector3.new(1,1,1)),"DiamondPlate")
  390. Part(propr,CFrame.new(0,-.35,0),CFrame.new(),Vector3.new(.5,.15,.5),body3,body3ref,0,Mesh("CylinderMesh",Vector3.new(1,1,1)),"DiamondPlate")
  391. Part(propr,CFrame.Angles(0,0*math.pi*2/3,0)*CFrame.new(0,0,.3),CFrame.new(),Vector3.new(.15,.65,.3),body3,body3ref,0,nil,"DiamondPlate")
  392. Part(propr,CFrame.Angles(0,1*math.pi*2/3,0)*CFrame.new(0,0,.3),CFrame.new(),Vector3.new(.15,.65,.3),body3,body3ref,0,nil,"DiamondPlate")
  393. Part(propr,CFrame.Angles(0,2*math.pi*2/3,0)*CFrame.new(0,0,.3),CFrame.new(),Vector3.new(.15,.65,.3),body3,body3ref,0,nil,"DiamondPlate")
  394. propr.Name = "SoundPlayer2"
  395. local ps = Instance.new("Sound",propr)
  396. ps.SoundId = "rbxassetid://134145308"
  397. ps.Pitch = 2
  398. ps.Volume = 1
  399. ps.Looped = true
  400. ps:Play()
  401.  
  402. local p = Part(propr,CFrame.Angles(0,0*math.pi*2/3,0)*CFrame.new(0,0,.35+.8)*CFrame.Angles(0,0,1.3),CFrame.new(),Vector3.new(.05,.5,1.7),body2,body2ref,0,nil,"Plastic")
  403. Part(p,CFrame.Angles(0,0,-1.3)*CFrame.new(.125,0,.85),CFrame.new(),Vector3.new(.7,.25,.05),body2,body2ref,0,nil,"Plastic")
  404. local p = Part(propr,CFrame.Angles(0,1*math.pi*2/3,0)*CFrame.new(0,0,.35+.8)*CFrame.Angles(0,0,1.3),CFrame.new(),Vector3.new(.05,.5,1.7),body2,body2ref,0,nil,"Plastic")
  405. Part(p,CFrame.Angles(0,0,-1.3)*CFrame.new(.125,0,.85),CFrame.new(),Vector3.new(.7,.25,.05),body2,body2ref,0,nil,"Plastic")
  406. local p = Part(propr,CFrame.Angles(0,2*math.pi*2/3,0)*CFrame.new(0,0,.35+.8)*CFrame.Angles(0,0,1.3),CFrame.new(),Vector3.new(.05,.5,1.7),body2,body2ref,0,nil,"Plastic")
  407. Part(p,CFrame.Angles(0,0,-1.3)*CFrame.new(.125,0,.85),CFrame.new(),Vector3.new(.7,.25,.05),body2,body2ref,0,nil,"Plastic")
  408.  
  409.  
  410.  
  411. local p1 = Part(main,CFrame.new(-1.85,.35,-1.1)*CFrame.Angles(0,math.pi/2,0),CFrame.new(),Vector3.new(1.25,.7,.7),pipe,piperef,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  412. Part(p1,CFrame.new(.5,0,.025),CFrame.new(),Vector3.new(1.5,1,1),pipe2,pipe2ref,0,Mesh("SpecialMesh",Vector3.new(.7,.85,.85),"Cylinder"),"DiamondPlate")
  413. Part(p1,CFrame.new(-.625,0,0),CFrame.new(),Vector3.new(.7,.7,.7),pipe,piperef,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Sphere"))
  414. local p1 = Part(p1,CFrame.new(-.625,0,0)*CFrame.Angles(0,0,-1)*CFrame.new(-.95,0,0),CFrame.new(),Vector3.new(1.9,.7,.7),pipe,piperef,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  415. Part(p1,CFrame.new(-.95,0,0),CFrame.new(),Vector3.new(.7,.7,.7),pipe,piperef,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Sphere"))
  416. local p1 = Part(p1,CFrame.new(-.95,0,0)*CFrame.Angles(0,0,1)*CFrame.new(-1.25,0,0),CFrame.new(),Vector3.new(2.5,.7,.7),pipe,piperef,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  417. local p = Part(p1,CFrame.new(-.3,0,.01),CFrame.new(),Vector3.new(1.5,1,1),pipe2,pipe2ref,0,Mesh("SpecialMesh",Vector3.new(1,.8,.8),"Cylinder"),"DiamondPlate")
  418. Part(p,CFrame.new(.6,0,0),CFrame.new(),Vector3.new(.15,.9,.9),pipe3,pipe3ref,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  419. Part(p,CFrame.new(-.6,0,0),CFrame.new(),Vector3.new(.15,.9,.9),pipe3,pipe3ref,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  420. Part(p,CFrame.new(0,0,.65),CFrame.new(),Vector3.new(1.3,.3,.5),pipe3,pipe3ref,0)
  421. Part(p1,CFrame.new(-1.25,0,0),CFrame.new(),Vector3.new(.15,.65,.65),pipe3,pipe3ref,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  422. local p = Part(p1,CFrame.new(-1.35,0,0)*CFrame.Angles(math.pi/2,0,math.pi/2),CFrame.new(),Vector3.new(1,1,1),pipe3,pipe3ref,0,Mesh("SpecialMesh",Vector3.new(.5,2,.5),"FileMesh","rbxassetid://16659502"))
  423. local firel = Instance.new("Fire",p)
  424. local lightl = Instance.new("PointLight",p)
  425.  
  426. local p1 = Part(main,CFrame.new(1.85,.35,-1.1)*CFrame.Angles(0,math.pi/2,0),CFrame.new(),Vector3.new(1.25,.7,.7),pipe,piperef,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  427. Part(p1,CFrame.new(.5,0,-.025),CFrame.new(),Vector3.new(1.5,1,1),pipe2,pipe2ref,0,Mesh("SpecialMesh",Vector3.new(.7,.85,.85),"Cylinder"),"DiamondPlate")
  428. Part(p1,CFrame.new(-.625,0,0),CFrame.new(),Vector3.new(.7,.7,.7),pipe,piperef,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Sphere"))
  429. local p1 = Part(p1,CFrame.new(-.625,0,0)*CFrame.Angles(0,0,-1)*CFrame.new(-.95,0,0),CFrame.new(),Vector3.new(1.9,.7,.7),pipe,piperef,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  430. Part(p1,CFrame.new(-.95,0,0),CFrame.new(),Vector3.new(.7,.7,.7),pipe,piperef,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Sphere"))
  431. local p1 = Part(p1,CFrame.new(-.95,0,0)*CFrame.Angles(0,0,1)*CFrame.new(-1.25,0,0),CFrame.new(),Vector3.new(2.5,.7,.7),pipe,piperef,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  432. local p = Part(p1,CFrame.new(-.3,0,-.01),CFrame.new(),Vector3.new(1.5,1,1),pipe2,pipe2ref,0,Mesh("SpecialMesh",Vector3.new(1,.8,.8),"Cylinder"),"DiamondPlate")
  433. Part(p,CFrame.new(.6,0,0),CFrame.new(),Vector3.new(.15,.9,.9),pipe3,pipe3ref,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  434. Part(p,CFrame.new(-.6,0,0),CFrame.new(),Vector3.new(.15,.9,.9),pipe3,pipe3ref,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  435. Part(p,CFrame.new(0,0,-.65),CFrame.new(),Vector3.new(1.3,.3,.5),pipe3,pipe3ref,0)
  436. Part(p1,CFrame.new(-1.25,0,0),CFrame.new(),Vector3.new(.15,.65,.65),pipe3,pipe3ref,0,Mesh("SpecialMesh",Vector3.new(1,1,1),"Cylinder"))
  437. local p = Part(p1,CFrame.new(-1.35,0,0)*CFrame.Angles(math.pi/2,0,math.pi/2),CFrame.new(),Vector3.new(1,1,1),pipe3,pipe3ref,0,Mesh("SpecialMesh",Vector3.new(.5,2,.5),"FileMesh","rbxassetid://16659502"))
  438. local firer = Instance.new("Fire",p)
  439. local lightr = Instance.new("PointLight",p)
  440.  
  441. cancollide = false
  442. local s = Part(main,CFrame.new(1.05,3,-2.7)*CFrame.Angles(-.5,0,0)*CFrame.new(0,0,.75),CFrame.new(),Vector3.new(.3,.3,1.5),body,bodyref,0)
  443. local s = Part(s,CFrame.new(0,.15,.75)*CFrame.Angles(.55,0,0)*CFrame.new(0,-.15,1.5),CFrame.new(),Vector3.new(.299,.3,3),body,bodyref,0)
  444. local s = Part(s,CFrame.new(0,.15,1.5)*CFrame.Angles(1.05,0,0)*CFrame.new(0,-.15,1),CFrame.new(),Vector3.new(.3,.3,2),body,bodyref,0)
  445. Part(s,CFrame.new(0,0,.75),CFrame.new(),Vector3.new(.4,.4,.4),pipe3,pipe3ref,0)
  446.  
  447. local s = Part(main,CFrame.new(-1.05,3,-2.7)*CFrame.Angles(-.5,0,0)*CFrame.new(0,0,.75),CFrame.new(),Vector3.new(.3,.3,1.5),body,bodyref,0)
  448. local s = Part(s,CFrame.new(0,.15,.75)*CFrame.Angles(.55,0,0)*CFrame.new(0,-.15,1.5),CFrame.new(),Vector3.new(.299,.3,3),body,bodyref,0)
  449. local s = Part(s,CFrame.new(0,.15,1.5)*CFrame.Angles(1.05,0,0)*CFrame.new(0,-.15,1),CFrame.new(),Vector3.new(.3,.3,2),body,bodyref,0)
  450. Part(s,CFrame.new(0,0,.75),CFrame.new(),Vector3.new(.4,.4,.4),pipe3,pipe3ref,0)
  451. cancollide = true
  452.  
  453. local hp = Instance.new("Part",m)
  454. hp.Anchored = true
  455. hp.TopSurface,hp.BottomSurface =0,0
  456. hp.BrickColor = BrickColor.new("Dark red")
  457. hp.FormFactor = "Custom"
  458. hp.CanCollide = false
  459. hp.Size = Vector3.new(8,1.5,.5)
  460.  
  461. local hptop = hp:Clone()
  462. hptop.Parent = m
  463. hptop.BrickColor = BrickColor.new("Dark green")
  464.  
  465. firer.Size = .01
  466. firer.Heat = 1000
  467. firel.Size = .01
  468. firel.Heat = 1000
  469.  
  470. local hm = Instance.new("Sound",sg)
  471. hm.SoundId = "rbxassetid://131864673"
  472. hm.Pitch = .8
  473.  
  474. --[[coroutine.wrap(function()
  475. wait(.2)
  476. while wait(.6) do
  477. ps.Pitch = -ps.Pitch
  478. ps2.Pitch = -ps2.Pitch
  479. end
  480. end)()]]
  481.  
  482. local bvel = Instance.new("BodyVelocity",main)
  483. bvel.maxForce = Vector3.new()
  484. bvel.velocity = Vector3.new()
  485. bvel.P = 5000
  486.  
  487. local bgyro = Instance.new("BodyGyro",main)
  488. bgyro.maxTorque = Vector3.new()
  489. bgyro.cframe = main.CFrame
  490. bgyro.D = 800
  491.  
  492. do
  493. local vecs = {}
  494. for i,v in pairs(Enum.NormalId:GetEnumItems()) do
  495. table.insert(vecs,Vector3.FromNormalId(v))
  496. end
  497. function getSide(h,r)
  498.  
  499. local ob = h.CFrame:pointToObjectSpace(r)
  500. if h:IsA("Part") and h.Shape == Enum.PartType.Ball then
  501. return (r-h.Position).unit
  502. elseif h:IsA("Part") and h.Shape == Enum.PartType.Cylinder then
  503. if isClose(math.abs(ob.y),h.Size.Y/2) then -- top
  504. return h.CFrame:vectorToWorldSpace((ob*Vector3.new(0,1,0)).unit)
  505. else
  506. return h.CFrame:vectorToWorldSpace(CFrame.new(Vector3.new(),ob*Vector3.new(1,0,1)).lookVector)
  507. end
  508. elseif h:IsA("WedgePart") then
  509. vecs = {Vector3.new(0,-1,0),Vector3.new(1,0,0),Vector3.new(-1,0,0),Vector3.new(0,0,1)}
  510. end
  511. for i,v in pairs(vecs) do
  512. if (ob*v/(h.Size/2)*v):isClose(v) then
  513. return h.CFrame:vectorToWorldSpace(v)
  514. end
  515. end
  516. if h:IsA("WedgePart") then
  517. return h.CFrame:vectorToWorldSpace(Vector3.new(0,h.Size.Z,h.Size.Y).unit)
  518. end
  519. end
  520. end
  521.  
  522. local function Raycast(ray,ign)
  523. local ign = ign or {m,char}
  524. local h,p = workspace:FindPartOnRayWithIgnoreList(ray,ign)
  525. if h and not h.CanCollide then
  526. table.insert(ign,h)
  527. return Raycast(ray,ign)
  528. else
  529. return h,p
  530. end
  531. end
  532.  
  533. local cam = workspace.CurrentCamera
  534. local vehicleOn = true
  535. local lastVehicleOn = false
  536. local acc = 0
  537. local maxSpeed = 180
  538. local spd = 0
  539. local jump = false
  540.  
  541. local kd = {}
  542. local function isDown(k)
  543. return kd[k:byte()] and 1 or 0
  544. end
  545. mouse.KeyDown:connect(function(k)
  546. kd[k:byte()] = true
  547. if k == "f" then
  548. vehicleOn = not vehicleOn
  549. elseif k == "r" then
  550. -- hval.Value = 0
  551. end
  552. end)
  553. mouse.KeyUp:connect(function(k)
  554. kd[k:byte()] = false
  555. end)
  556.  
  557. mouse.Button1Down:connect(function()
  558. b1d = true
  559. end)
  560. mouse.Button1Up:connect(function()
  561. b1d = false
  562. end)
  563. mouse.Button2Down:connect(function()
  564. b2d = true
  565. end)
  566. mouse.Button2Up:connect(function()
  567. b2d = false
  568. end)
  569.  
  570.  
  571. hum.Changed:connect(function()
  572. if hum.Jump then
  573. jump = true
  574. hum.Jump = false
  575. hum.Sit = true
  576. end
  577. end)
  578.  
  579. local fire = {}
  580.  
  581. mouse.TargetFilter = m
  582.  
  583. local t,delta = tick(),0
  584. local smokers = {}
  585.  
  586. local guntimer = 0
  587. local scon;
  588. local lastjump = 0
  589. scon = step:connect(function()
  590.  
  591. local now = tick()
  592. delta,t = now-t,now
  593.  
  594. if hval.Value <= 0 then
  595. game:service'Debris':AddItem(m,5)
  596. coroutine.wrap(function()
  597. bvel:Destroy()
  598. local parts = {}
  599. local function a(b)
  600. for i,v in pairs(b:GetChildren()) do
  601. if v:IsA("BasePart") then
  602. table.insert(parts,v)
  603. end
  604. a(v)
  605. end
  606. end
  607. a(m)
  608. bvel:Destroy()
  609. bgyro:Destroy()
  610. local aTouched = false
  611. for i,v in pairs(parts) do
  612. v.Touched:connect(function()
  613. if aTouched then return end
  614. aTouched = true
  615. local exp = Instance.new("Explosion",workspace)
  616. exp.Position = v.Position
  617. exp.BlastRadius = 0
  618. exp.BlastPressure = .5
  619. m:BreakJoints()
  620. char:BreakJoints()
  621. for i,x in pairs(m:GetChildren()) do
  622. if x:IsA("BasePart") and v ~= x then
  623. local diff = (x.Position-v.Position)
  624. x.Velocity = x.Velocity + diff.unit * diff.magnitude/0.25/v:GetMass()
  625. end
  626. end
  627. script.Disabled = true
  628. end)
  629. end
  630. wait(5)
  631. script.Disabled = true
  632. end)()
  633. scon:disconnect()
  634. return
  635. else
  636. hp.Transparency = hval.Value == 100 and math.min(1,hp.Transparency+.05) or math.max(0,hp.Transparency-.05)
  637. hptop.Transparency = hp.Transparency
  638. hp.CFrame = CFrame.new(head.Position+Vector3.new(0,9,0))*CFrame.Angles(0,(tick()/2)%(math.pi*2),0)
  639. hptop.Size = Vector3.new(hval.Value/100*(hp.Size.X+.05),hp.Size.Y+.1,hp.Size.Z+.1)
  640. hptop.CFrame = hp.CFrame * CFrame.new(-hp.Size.X/2-.025+hptop.Size.X/2,0,0)
  641. end
  642.  
  643. if b1d and vehicleOn then
  644. guntimer = guntimer + delta
  645. if guntimer > .1 then
  646. t1s:Play()
  647. t1s.Pitch = 1.5 + (math.random()-.5)*.1
  648. guntimer = guntimer - .1
  649. local b = Instance.new("Part",m)
  650. b.Anchored = true
  651. b.FormFactor = "Custom"
  652. b.TopSurface,b.BottomSurface = 0,0
  653. b.CanCollide = false
  654. b.BrickColor = BrickColor.new("Bright yellow")
  655. b.Size = Vector3.new(.2,.2,.8)
  656. local sm = Instance.new("SpecialMesh",b)
  657. sm.MeshId = "rbxassetid://2697549"
  658. sm.Scale = Vector3.new(.5,.5,.25)
  659. local orig = t1.CFrame*CFrame.new(.5,0,0)*CFrame.Angles(0,-math.pi/2,0)
  660. local vel = (mouse.Hit.p-orig.p).unit*250 + main.Velocity*delta
  661. b.CFrame = orig
  662. coroutine.wrap(function()
  663. local t = tick()
  664. while true do
  665. step:wait()
  666. local n = tick()
  667. local d,t = n-t,n
  668. local ocf = b.CFrame
  669. local h,r = Raycast(Ray.new(ocf.p,vel*d),{char,m})
  670. if h then
  671. b:Destroy()
  672. local hit = false
  673. local hp = h.Parent:FindFirstChild("hp") or h.Parent.Parent:FindFirstChild("hp")
  674. if hp and hp:IsA("NumberValue") then
  675. hp.Value = hp.Value - 3
  676. hit = "rbxassetid://142082170"
  677. end
  678. local hp = h.Parent:FindFirstChild("Humanoid") or h.Parent.Parent:FindFirstChild("Humanoid")
  679. if hp and hp:IsA("Humanoid") then
  680. hp.Health = hp.Health - 3
  681. hit = "rbxassetid://133758570"
  682. end
  683. if hit then
  684. hm:Play()
  685. local sp = Instance.new("Part",m)
  686. sp.FormFactor = "Custom"
  687. sp.Size = Vector3.new()
  688. sp.Transparency = 1
  689. sp.Anchored = true
  690. sp.CanCollide = false
  691. sp.CFrame = CFrame.new(r)
  692. local s = Instance.new("Sound",sp)
  693. s.SoundId = hit
  694. s.Volume = 1
  695. s.Pitch = 1.1+math.random()*.2
  696. wait()
  697. s:Play()
  698. game:service'Debris':AddItem(sp,5)
  699. end
  700. break
  701. end
  702. b.CFrame = CFrame.new(ocf.p+vel*d,ocf.p+vel*d*2)
  703. sm.Scale = Vector3.new(.5-vel.magnitude*d/100,.5-vel.magnitude*d/100,vel.magnitude*d/3)
  704. vel = vel - Vector3.new(0,4*d,0)
  705. if ocf.Y < -100 then
  706. b:Destroy()
  707. break
  708. end
  709. end
  710. end)()
  711. end
  712. else
  713. guntimer = 0
  714. end
  715.  
  716. local mcfr = main.CFrame
  717. local mpos = mcfr.p
  718.  
  719. local raydir = Vector3.new(0,-100,0)--mcfr:vectorToWorldSpace(Vector3.new(0,-100,0))
  720.  
  721. local dhit,dray = Raycast(Ray.new(mpos,raydir),{char,m})
  722. local diff = dray-mpos
  723.  
  724. local rays = {
  725. tip = Ray.new((mcfr*CFrame.new(0,0,-11.5)).p,raydir),
  726. Ray.new((mcfr*CFrame.new(7,0,-11)).p,raydir),
  727. Ray.new((mcfr*CFrame.new(-7,0,-11)).p,raydir),
  728. Ray.new((mcfr*CFrame.new(1,0,-10.5)).p,raydir),
  729. Ray.new((mcfr*CFrame.new(-1,0,-10.5)).p,raydir),
  730. Ray.new((mcfr*CFrame.new(2.5,0,-6)).p,raydir),
  731. Ray.new((mcfr*CFrame.new(-2.5,0,-6)).p,raydir),
  732. rtip = Ray.new((mcfr*CFrame.new(10.5,0,-3)).p,raydir),
  733. ltip = Ray.new((mcfr*CFrame.new(-10.5,0,-3)).p,raydir),
  734. rprop = Ray.new((mcfr*CFrame.new(6.5,0,-3)).p,raydir),
  735. lprop = Ray.new((mcfr*CFrame.new(-6.5,0,-3)).p,raydir),
  736. Ray.new((mcfr*CFrame.new(2.5,0,-3)).p,raydir),
  737. Ray.new((mcfr*CFrame.new(-2.5,0,-3)).p,raydir),
  738. Ray.new((mcfr*CFrame.new(6.5,0,-1)).p,raydir),
  739. Ray.new((mcfr*CFrame.new(-6.5,0,-1)).p,raydir),
  740. Ray.new((mcfr*CFrame.new(2.5,0,4)).p,raydir),
  741. Ray.new((mcfr*CFrame.new(-2.5,0,4)).p,raydir),
  742. Ray.new((mcfr*CFrame.new(2.5,0,2)).p,raydir),
  743. Ray.new((mcfr*CFrame.new(-2.5,0,2)).p,raydir),
  744. }
  745. for i,v in pairs(rays) do
  746. local h,r = Raycast(v,{char,m})
  747. local df = r-v.Origin
  748. if df.Y > diff.Y then
  749. diff = df
  750. end
  751. rays[i] = {r=r,d=df,h=h}
  752. end
  753.  
  754. local moving = false
  755. local movdir = Vector3.new()
  756. local hoverHeight = 7 + math.sin(now)/2
  757. local vel = Vector3.new(0,(hoverHeight+diff.Y)*3,0)
  758. if isDown'w'+isDown's'+isDown'd'+isDown'a' > 0 then
  759. moving = true
  760. movdir = Vector3.new(isDown'd'-isDown'a',0,isDown's'-isDown'w')
  761. if movdir.magnitude < .001 then
  762. moving = false
  763. else
  764. movdir = movdir.unit
  765. end
  766. end
  767. bgyro.maxTorque = Vector3.new(1,1,1)*1e5
  768.  
  769. if vehicleOn then
  770. if not lastVehicleOn or not lastDown then
  771. lastDown = tick()
  772. end
  773. if not lastVehicleOn then
  774. local ray = rays.rprop
  775. for a,ray in pairs({rays.rprop,rays.lprop}) do
  776. if ray.h and -ray.d.Y < 5 then
  777. local x = a==1 and 1 or -1
  778. local am = 0
  779. for i=math.pi/4*x,x*(-math.pi-math.pi/4),x*-math.pi/8 do
  780. local p = Instance.new("Part",m)
  781. p.Anchored = true
  782. p.Transparency = 1
  783. p.CanCollide = false
  784. p.FormFactor = "Custom"
  785. p.Size = Vector3.new()
  786. local smoke = Instance.new("Smoke",p)
  787. smoke.Color = Color3.new(.5,.5,.5)--Color3.new(lerp(.5,ray.h.Color.r,.8),lerp(.5,ray.h.Color.g,.8),lerp(.5,ray.h.Color.b,.8))
  788. smoke.Size = .1
  789. smoke.Opacity = .04
  790. smoke.RiseVelocity = 10
  791. p.CFrame = CFrame.new(ray.r,ray.r+mcfr.lookVector*Vector3.new(1,0,1))*CFrame.Angles(math.pi/2,0,i+.2*x)*CFrame.new(0,2.5,0)
  792. local add = am/13
  793. if add > .5 then
  794. add = 1-add
  795. end
  796. am = am + 1
  797. game.Debris:AddItem(p,.75+add*14)
  798. end
  799. end
  800. end
  801. end
  802. local ovel = main.CFrame:vectorToObjectSpace(main.Velocity)
  803.  
  804. local xrot = math.max(-1,math.min(1,ovel.Z/maxSpeed*2))*.25
  805. local zrot = math.max(-1,math.min(1,-ovel.X/maxSpeed*2))*.25
  806. local xadd,zadd = 0,0
  807. if rays.tip.h and dhit and (-rays.tip.d.Y < hoverHeight+10 or -diff.Y < hoverHeight+10) then
  808. local ydiff = rays.tip.r.Y-dray.Y
  809. --print(ydiff)
  810. xadd = math.max(-.75,math.min(.75,math.asin(ydiff/11.5)))
  811. xrot = xrot*math.cos(xadd) + xadd
  812. --print("x",movdir,xadd)
  813. movdir = CFrame.Angles(xadd,0,0)*movdir
  814. --print("x2",movdir)
  815. end
  816.  
  817. if rays.lprop.h and rays.rprop.h and rays.lprop.h == rays.rprop.h and (-rays.lprop.d.Y < hoverHeight+10 or -rays.rprop.d.Y < hoverHeight+10) then
  818. local xdiff = rays.rprop.r.Y-rays.lprop.r.Y
  819. zadd = math.max(-.75,math.min(.75,math.asin(xdiff/22)))
  820. zrot = zrot*math.cos(zadd) + zadd
  821. --print("z",movdir,zadd)
  822. movdir = CFrame.Angles(0,0,zadd)*movdir
  823. --print("z2",movdir)
  824. end
  825. --[[
  826. if movdir.magnitude > .001 then
  827. local p = Instance.new("Part",m)
  828. p.Anchored = true
  829. p.FormFactor = "Custom"
  830. p.CanCollide = false
  831. p.FrontSurface = "Hinge"
  832. p.Size = Vector3.new(1,1,3)
  833. p.CFrame = CFrame.new(head.Position+Vector3.new(0,5,0),head.Position+Vector3.new(0,5,0)+CFrame.new(cam.CoordinateFrame.p,cam.CoordinateFrame.p+cam.CoordinateFrame.lookVector*Vector3.new(1,0,1)):vectorToWorldSpace(movdir))
  834. game.Debris:AddItem(p,.1)
  835. end
  836. ]]
  837. local windup = math.min(1,(tick()-lastDown))
  838.  
  839. if windup < .25 then
  840. moving = false
  841. elseif windup < 1 then
  842. bgyro.maxTorque = Vector3.new(1,1,1)*50000
  843. end
  844. local ldir = windup >= .25 and cam.CoordinateFrame.lookVector*Vector3.new(1,0,1) or main.CFrame.lookVector*Vector3.new(1,0,1)
  845. bgyro.cframe = CFrame.new(main.CFrame.p,main.CFrame.p+ldir)*CFrame.Angles(xrot,0,zrot)
  846. proplw.C1 = proplw.C1 * CFrame.Angles(0,windup*-(.8+main.Velocity.magnitude/maxSpeed*.75)*(moving and 1.5 or 1)+math.random()*.05,0)
  847. proprw.C1 = proprw.C1 * CFrame.Angles(0,windup*(.8+main.Velocity.magnitude/maxSpeed*.75)*(moving and 1.5 or 1)+math.random()*.05,0)
  848.  
  849. local odir = main.CFrame:vectorToObjectSpace(bgyro.cframe.lookVector)
  850. firer.Enabled = ovel.Z < -1 or odir.X < -.1
  851. firel.Enabled = ovel.Z < -1 or odir.X > .1
  852. bvel.maxForce = Vector3.new(70000,-diff.Y < hoverHeight+1+math.max(0,-main.Velocity.Y*delta*40) and 400000 or 40000,70000)
  853.  
  854. windup = windup + main.Velocity.magnitude/maxSpeed*.35*(moving and 1.5 or 1)
  855. ps.Volume = windup*.07
  856. ps2.Volume = ps.Volume
  857. ps.Pitch = ps.Pitch
  858. ps2.Pitch = ps2.Pitch
  859. else
  860. if lastVehicleOn or not lastUp then
  861. lastUp = tick()
  862. end
  863. firel.Enabled,firer.Enabled = false,false
  864. bvel.maxForce = Vector3.new(40000,-diff.Y > 1 and 1e5 or 0,40000)
  865. vel = Vector3.new(0,-100-((tick()-lastUp)*9.81*10)^2,0)
  866. bgyro.cframe = clerp(bgyro.cframe,CFrame.new(mpos,mpos+mcfr.lookVector*Vector3.new(1,0,1)),.2)
  867.  
  868. local windup = 1-math.min(1,(tick()-lastUp)/5)
  869. vel = Vector3.new(0,(1-windup)*-25,0)
  870. proplw.C1 = proplw.C1 * CFrame.Angles(0,-.8*windup,0)
  871. proprw.C1 = proprw.C1 * CFrame.Angles(0,.8*windup,0)
  872. ps.Volume = windup*.07
  873. ps2.Volume = ps.Volume
  874. ps.Pitch = ps.Pitch
  875. ps2.Pitch = ps2.Pitch
  876.  
  877. moving = false
  878.  
  879. if tick()-lastUp > 2 then
  880. hval.Value = math.min(100,hval.Value + .1)
  881. end
  882. end
  883.  
  884. if moving then
  885. local od = movdir
  886. movdir = CFrame.new(cam.CoordinateFrame.p,cam.CoordinateFrame.p+cam.CoordinateFrame.lookVector*Vector3.new(1,0,1)):vectorToWorldSpace(movdir*Vector3.new(1,.25,1))
  887.  
  888. if movdir.magnitude < 0.001 or tostring(movdir):lower():find("nan") then
  889. moving = false
  890. --print(od)
  891. else
  892. movdir = movdir.unit
  893. acc = acc + delta*70
  894. spd = math.min(maxSpeed,spd + acc)
  895. vel = vel + movdir*spd
  896. end
  897. end
  898. if not moving then
  899. spd = 0
  900. acc = 0
  901. end
  902.  
  903. bvel.velocity = vel
  904. if jump then
  905. if vehicleOn and -diff.Y < hoverHeight + 1 and tick()-lastjump > 2 then
  906. tor.Velocity = tor.Velocity + Vector3.new(0,110,0)
  907. lastjump = tick()
  908. end
  909. jump = false
  910. end
  911. lightr.Range = 5+math.sin(tick()*50)
  912. lightl.Range = 5+math.cos(tick()*50)
  913.  
  914. lightr.Color = firer.Color
  915. lightl.Color = firel.Color
  916.  
  917. lightr.Enabled = firer.Enabled
  918. lightl.Enabled = firel.Enabled
  919. lastVehicleOn = vehicleOn
  920. end)
  921.  
  922. char.AncestryChanged:connect(function()
  923. m:Destroy()
  924. scon:disconnect()
  925. end)
  926.  
  927. end
  928. return _G.mantisReload()
Add Comment
Please, Sign In to add comment