Advertisement
simplistic27

Mantis

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