Advertisement
NextFlamePB

ROBLOX Mantis Script

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