Black Mantis


SUBMITTED BY: Pamlau

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

FORMAT: Lua

SIZE: 48.4 kB

HITS: 353

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

comments powered by Disqus