Advertisement
SonicrixLP

Untitled

Feb 17th, 2017
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local p = game:service'Players'.sonicrixlp
  2. local c = p.Character
  3. local bp = p.Backpack
  4. pcall(function() _G.mm:Remove() end)
  5. pcall(function() bp.RMTank:Remove() end)
  6. it = Instance.new
  7. v3=Vector3.new
  8. bc=BrickColor.new
  9. c3=Color3.new
  10. cn=CFrame.new
  11. ca=CFrame.Angles
  12. ti=table.insert
  13. tr=table.remove
  14. rn=math.random
  15. rd=math.rad
  16. mf=math.floor
  17. asset = "http://www.roblox.com/asset/?id="
  18. ds = {}
  19. ds.Claw = "10681506"
  20. ds.Ring = "3270017"
  21. ds.Crack = "49173398"
  22. ds.Cloud = "1095708"
  23. ds.Spike = "1033714"
  24. ds.Rock = "1290033"
  25. ds.Crown = "1323306"
  26. ds.Hood = "16952952"
  27. ds.Slash = "10209645"
  28. ds.Slash2 = "46760716"
  29. ds.MadFace = "2235131"
  30. ds.BanditMask = "20637493"
  31. ds.Hood2 = "25211365"
  32. ds.HoodT2 = "64240784"
  33. ds.Axe = "12768042"
  34. ds.AxeT = "12768034"
  35. ds.Fist = "65322375"
  36. ds.Tree1 = "1090398"
  37. ds.Vine = "13108500"
  38. ds.VineT = "17585271"
  39. ds.TreeTexture = "2861779"
  40. ds.Tug = "31173820" -- sound
  41. ds.Fire = "2693346" --"2760979"
  42. ds.Hit = "2801263"
  43. ds.BulletHole = "64291961"
  44. ds.Camo = "4268107"
  45. table.foreach(ds,function(a,b)
  46. if tonumber(b:sub(1,3)) then
  47. ds[a] = asset .. b game:service'ContentProvider':Preload(ds[a])
  48. end
  49. end)
  50. q = function(f)
  51. coroutine.resume(coroutine.create(function()
  52. f()
  53. end))
  54. end
  55. ft = function(tablez,item)
  56. for i=1,#tablez do
  57. if tablez[i] == item then
  58. return i
  59. end
  60. end
  61. return nil
  62. end
  63. pa = function(pa,pn,sh,x,y,z,c,a,tr,re,bc2)
  64. local fp=nil
  65. if sh ~= "Wedge" and sh ~= "CornerWedge" and sh ~= "VehicleSeat" and sh ~= "Seat" then
  66. fp=it("Part",pa)
  67. fp.Shape=sh
  68. fp.formFactor="Custom"
  69. elseif sh == "Wedge" then
  70. fp=it("WedgePart",pa)
  71. fp.formFactor="Custom"
  72. elseif sh == "CornerWedge" then
  73. fp=it("CornerWedgePart",pa)
  74. elseif sh == "VehicleSeat" then
  75. fp=it("VehicleSeat",pa)
  76. elseif sh == "Seat" then
  77. fp=it("Seat",pa)
  78. end
  79. fp.Size=v3(x,y,z)
  80. fp.Friction = 2
  81. fp.CanCollide=c
  82. fp.Anchored=false
  83. fp.BrickColor=bc(bc2)
  84. fp.Transparency=tr
  85. fp.Reflectance=re
  86. fp.BottomSurface=0
  87. fp.Name=pn
  88. fp.Locked = true
  89. --fp.FrontSurface="Hinge"
  90. fp.TopSurface=0
  91. fp.CFrame = cn(-9000,9000,-9000)
  92. fp:BreakJoints()
  93. fp.Anchored = a
  94. return fp
  95. end
  96. weld = function(pa,p0,p1,x,y,z,a,b,c)
  97. local fw=it("Weld",pa)
  98. fw.Part0=p0
  99. fw.Part1=p1
  100. fw.C0=cn(x,y,z) *ca(a,b,c)
  101. return fw
  102. end
  103. fade = function(prt,incr)
  104. q(function()
  105. for i=prt.Transparency,1,incr do
  106. prt.Transparency=i
  107. wait()
  108. end
  109. prt:Remove''
  110. end)
  111. end
  112. stick = function(hit2,hit)
  113. local weld=it("Weld")
  114. weld.Part0=hit2
  115. weld.Part1=hit
  116. local HitPos=hit2.Position
  117. local CJ=cn(HitPos)
  118. local C0=hit2.CFrame:inverse() *CJ
  119. local C1=hit.CFrame:inverse() * CJ
  120. weld.C0=C0
  121. weld.C1=C1
  122. weld.Parent=hit2
  123. end
  124. ray = function(Pos, Dir,xxz)
  125. local xxz2=c
  126. if xxz ~= nil then
  127. xxz2=nil
  128. end
  129. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit *999),xxz2)
  130. end
  131. ft2 = function(tablez,item)
  132. for i=1,#tablez do
  133. if tablez[i][1] == item then
  134. return i
  135. end
  136. end
  137. return nil
  138. end
  139. Trail = function(ob,times,waitz,col,thickz,ofz)
  140. q(function()
  141. local oldpos=(ob.CFrame *ofz).p
  142. for i=1,times do
  143. local obp=(ob.CFrame *ofz).p
  144. local mag=(oldpos - obp).magnitude
  145. local tr=pa(ob,"trail","Block",0,0,0,false,false,0.5,0.15,col)
  146. tr.Anchored=true
  147. tr.CFrame=cn(oldpos,obp)
  148. tr.CFrame=tr.CFrame + tr.CFrame.lookVector* (mag/2)
  149. local trm=it("CylinderMesh",tr)
  150. trm.Scale=v3(5*thickz,mag*5,5*thickz)
  151. q(function()
  152. for i=5*thickz,0,-5*thickz/10 do
  153. trm.Scale=v3(i,mag*5,i)
  154. wait()
  155. end
  156. tr:Remove''
  157. end)
  158. tr.CFrame=tr.CFrame *ca(rd(90),0,0)
  159. oldpos=obp wait(waitz)
  160. end
  161. end)
  162. end
  163. qi = function(ttz)
  164. local qii = it(ttz[1],ttz[2])
  165. table.foreach(ttz,function(oi,oi2)
  166. if oi ~= 1 and oi ~= 2 then
  167. qii[oi] = oi2
  168. end
  169. end)
  170. return qii
  171. end
  172. de = function(it,ti) game:service'Debris':AddItem(it,ti) end
  173. GlowMesh = function(anch,meshid2,rootz,mv3,colzz,adjus,l1,l2,l3) q(function()
  174. local spi=pa(rootz,"","Block",1,1,1,false,false,l1,0,colzz) local spim=it("SpecialMesh",spi) if meshid2:lower()=="sphere" then spim.MeshType="Sphere" elseif meshid2:lower()=="block" then spim.MeshType="Brick" else spim.MeshType="FileMesh" spim.MeshId=meshid2 end
  175. if anch then local spiw=qi({"Weld",spi,Part0=rootz,Part1=spi}) spiw.C0 =spiw.C0 *adjus else spi.Anchored=true spi.CFrame=adjus end
  176. for i=l1,l2,l1 do spi.Transparency=i spim.Scale=mv3*(i+0.3) wait() end spi:Remove'' end)
  177. end
  178. DetectSurface = function(pos, part)
  179. local surface = nil
  180. local pospos = part.CFrame
  181. local pos2 = pospos:pointToObjectSpace(pos)
  182. local siz = part.Size
  183. local shaep = part.Shape
  184. if shaep == Enum.PartType.Ball or shaep == Enum.PartType.Cylinder then
  185. surface = {"Anything", cn(pospos.p, pos)*cn(0, 0, -(pospos.p - pos).magnitude+0.12)*ca(rd(-90), 0, 0)}
  186. else
  187. if pos2.Y > ((siz.Y/2)-0.01) then
  188. surface = {"Top", ca(0, 0, 0)}
  189. elseif pos2.Y < -((siz.Y/2)-0.01) then
  190. surface = {"Bottom", ca(-math.pi, 0, 0)}
  191. elseif pos2.X > ((siz.X/2)-0.01) then
  192. surface = {"Right", ca(0, 0, rd(-90))}
  193. elseif pos2.X < -((siz.X/2)-0.01) then
  194. surface = {"Left", ca(0, 0, rd(90))}
  195. elseif pos2.Z > ((siz.Z/2)-0.01) then
  196. surface = {"Back", ca(rd(90), 0, 0)}
  197. elseif pos2.Z < -((siz.Z/2)-0.01) then
  198. surface = {"Front", ca(rd(-90), 0, 0)}
  199. end end
  200. return surface
  201. end
  202. BulletHole = function(HitPos,HitObj,sc)
  203. local Surface = DetectSurface(HitPos, HitObj)
  204. local C = cn(HitPos) * ca(HitObj.CFrame:toEulerAnglesXYZ()) * Surface[2]
  205. if Surface[1] == "Anything" then C = Surface[2] end
  206. local bl = pa(workspace,"","Block",sc,0,sc,false,true,1,0,"") qi({"Decal",bl,Face="Top",Texture=ds.BulletHole})
  207. bl.CFrame = C*cn(0,-0.1,0) if not HitObj.Anchored then bl.Anchored = false stick(bl,HitObj) bl.ChildRemoved:connect(function() bl:Remove() end) end de(bl,5)
  208. end
  209. so = function(id,par,vol,pit) q(function()
  210. local sou = qi({"Sound",par or workspace,Volume=vol/1.5 or 0.75,Pitch=pit or 1,SoundId=id})
  211. wait() sou:play() wait(2) sou:Remove() end) end
  212. GetRegion = function(p0,p1,f,f2)
  213. q(function()
  214. for i,v in pairs(workspace:FindPartsInRegion3(Region3.new(p0,p1),c,100) ) do
  215. if v.Parent:findFirstChild("H") == nil and v.Name == "Torso" and v.Parent:findFirstChild("Humanoid") and v.Parent.Humanoid.Health > 0 and v.Parent:findFirstChild("Torso") then
  216. q(function()
  217. f(v.Parent)
  218. end)
  219. elseif f2 and v.Parent.Parent:findFirstChild("Humanoid") == nil then
  220. f2(v)
  221. end
  222. end
  223. end)
  224. end
  225. FindGround = function(pos)
  226. local ax,ay,az = pos:toEulerAnglesXYZ()
  227. local bhit,bpos=ray(pos.p,pos.p - (pos.p + v3(0,200,0)))
  228. if bhit and bpos then
  229. return cn(bpos)*ca(ax,ay,az)
  230. end
  231. return nil
  232. end
  233. MakeCrater = function(pos,sc,tyms,debz)
  234. q(function()
  235. if not debz then
  236. debz = 5
  237. end
  238. local bhit,bpos=ray(pos,pos - (pos + v3(0,200,0)))
  239. if bhit and bpos then
  240. for i=1,tyms do
  241. q(function()
  242. local gr = pa(misc,"","Block",rn(5,13)/10*sc,0.25*sc,rn(4,10)/10*sc,true,true,bhit.Transparency,bhit.Reflectance,bhit.BrickColor.Name)
  243. gr.Material = bhit.Material
  244. gr.TopSurface = bhit.TopSurface
  245. gr.CFrame = cn(bpos+v3(rn(-12,12)/10*sc,0,rn(-12,12)/10*sc))*ca(rd(rn(-40,40)),rd(rn(-360,360)),rd(rn(-40,40)))
  246. wait(debz)
  247. fade(gr,0.1)
  248. end)
  249. end
  250. end
  251. end)
  252. end
  253. MakeCrack = function(pos,sc,debz)
  254. q(function()
  255. if not debz then
  256. debz = 5
  257. end
  258. local bhit,bpos=ray(pos,pos - (pos + v3(0,10,0)))
  259. if bhit and bpos then
  260. local cr = pa(misc,"","Block",sc,0,sc,false,true,1,0,"") cr.CFrame = cn(bpos)
  261. local dec=qi({"Decal",cr,Face="Top",Texture=ds.Crack}) de(cr,debz)
  262. end
  263. end)
  264. end
  265. f1 = function(cff,hit2,hit)
  266. local HitPos=cff.p
  267. local CJ=cn(HitPos)
  268. local C0=cff:inverse() *CJ
  269. local C1=hit.CFrame:inverse() * CJ
  270. return C0,C1
  271. end
  272. a = {}
  273. a.insw={}
  274. function cleanweld(wexx,namzi)
  275. local tn=ft2(a.insw,wexx)
  276. if tn==nil then return end
  277. if namzi=="p0" then
  278. a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]=0,0,0 elseif namzi=="p1" then
  279. a.insw[tn][2]["p1x"],a.insw[tn][2]["p1y"],a.insw[tn][2]["p1z"]=0,0,0 elseif namzi=="a0" then
  280. a.insw[tn][2]["a0x"],a.insw[tn][2]["a0y"],a.insw[tn][2]["a0z"]=0,0,0 elseif namzi=="a1" then
  281. a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]=0,0,0
  282. end
  283. end
  284. function c2(wexx,smmx,c0orc1,aa,bb,cc,xx,yy,zz)
  285. q(function()
  286. c1(wexx,smmx,c0orc1,aa,bb,cc,xx,yy,zz)
  287. end)
  288. end
  289. a.Welding=0
  290. function c1(wexx,smmx,c0orc1,aa,bb,cc,xx,yy,zz)
  291. if ft2(a.insw,wexx)==nil then
  292. ti(a.insw,{wexx,{}})
  293. local tn=ft2(a.insw,wexx)
  294. a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]=wexx.C0.x,wexx.C0.y,wexx.C0.z
  295. a.insw[tn][2]["p1x"],a.insw[tn][2]["p1y"],a.insw[tn][2]["p1z"]=wexx.C1.x,wexx.C1.y,wexx.C1.z
  296. a.insw[tn][2]["a0x"],a.insw[tn][2]["a0y"],a.insw[tn][2]["a0z"]=wexx.C0:toEulerAnglesXYZ()
  297. a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]=wexx.C1:toEulerAnglesXYZ()
  298. end
  299. local tn=ft2(a.insw,wexx)
  300. local xx2,yy2,zz2=0,0,0
  301. local x2,y2,z2=0,0,0
  302. if c0orc1==0 then
  303. xx2,yy2,zz2=a.insw[tn][2]["a0x"],a.insw[tn][2]["a0y"],a.insw[tn][2]["a0z"]
  304. x2,y2,z2=a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]
  305. elseif c0orc1==1 then
  306. xx2,yy2,zz2=a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]
  307. x2,y2,z2=a.insw[tn][2]["p1x"],a.insw[tn][2]["p1y"],a.insw[tn][2]["p1z"]
  308. else
  309. xx2,yy2,zz2=a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]
  310. x2,y2,z2=a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]
  311. end a.Welding=a.Welding + 1
  312. local twa=1
  313. if smmx >= 1 then
  314. else
  315. for i=smmx,0.8,smmx do
  316. twa = 1
  317. if c0orc1==0 then
  318. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i)) *ca(xx2-(((xx2-rd(xx))/twa)*i),yy2-(((yy2-rd(yy))/twa)*i),zz2-(((zz2-rd(zz))/twa)*i))
  319. elseif c0orc1==1 then
  320. wexx.C1=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i)) *ca(xx2-(((xx2-rd(xx))/twa)*i),yy2-(((yy2-rd(yy))/twa)*i),zz2-(((zz2-rd(zz))/twa)*i))
  321. else local x,y,z = wexx.C0:toEulerAnglesXYZ()
  322. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i))*ca(x,y,z)
  323. wexx.C1=cn(wexx.C1.x,wexx.C1.y,wexx.C1.z)*ca(xx2-(((xx2-rd(xx))/twa)*i),yy2-(((yy2-rd(yy))/twa)*i),zz2-(((zz2-rd(zz))/twa)*i))
  324. end
  325. if fu then
  326. q(fu)
  327. end
  328. wait()
  329. end
  330. for i=0.8,1,smmx*0.45 do
  331. twa = 1
  332. if c0orc1==0 then
  333. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i)) *ca(xx2-(((xx2-rd(xx))/twa)*i),yy2-(((yy2-rd(yy))/twa)*i),zz2-(((zz2-rd(zz))/twa)*i))
  334. elseif c0orc1==1 then
  335. wexx.C1=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i)) *ca(xx2-(((xx2-rd(xx))/twa)*i),yy2-(((yy2-rd(yy))/twa)*i),zz2-(((zz2-rd(zz))/twa)*i))
  336. else local x,y,z = wexx.C0:toEulerAnglesXYZ()
  337. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i))*ca(x,y,z)
  338. wexx.C1=cn(wexx.C1.x,wexx.C1.y,wexx.C1.z)*ca(xx2-(((xx2-rd(xx))/twa)*i),yy2-(((yy2-rd(yy))/twa)*i),zz2-(((zz2-rd(zz))/twa)*i))
  339. end
  340. wait()
  341. end
  342. end
  343. local i=1
  344. if c0orc1==0 then
  345. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i)) *ca(xx2-(((xx2-rd(xx))/twa)*i),yy2-(((yy2-rd(yy))/twa)*i),zz2-(((zz2-rd(zz))/twa)*i))
  346. elseif c0orc1==1 then
  347. wexx.C1=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i)) *ca(xx2-(((xx2-rd(xx))/twa)*i),yy2-(((yy2-rd(yy))/twa)*i),zz2-(((zz2-rd(zz))/twa)*i))
  348. else local x,y,z = wexx.C0:toEulerAnglesXYZ()
  349. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i))*ca(x,y,z)
  350. wexx.C1=cn(wexx.C1.x,wexx.C1.y,wexx.C1.z)*ca(xx2-(((xx2-rd(xx))/twa)*i),yy2-(((yy2-rd(yy))/twa)*i),zz2-(((zz2-rd(zz))/twa)*i))
  351. end
  352. a.Welding=a.Welding - 1
  353. local tn=ft2(a.insw,wexx)
  354. if c0orc1==0 then
  355. a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]=x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i)
  356. a.insw[tn][2]["a0x"],a.insw[tn][2]["a0y"],a.insw[tn][2]["a0z"]=xx2-(((xx2-rd(xx))/twa)*i),yy2-(((yy2-rd(yy))/twa)*i),zz2-(((zz2-rd(zz))/twa)*i)
  357. elseif c0orc1==1 then
  358. a.insw[tn][2]["p1x"],a.insw[tn][2]["p1y"],a.insw[tn][2]["p1z"]=x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i)
  359. a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]=xx2-(((xx2-rd(xx))/twa)*i),yy2-(((yy2-rd(yy))/twa)*i),zz2-(((zz2-rd(zz))/twa)*i)
  360. elseif c0orc1==3 then
  361. local x,y,z=wexx.C0.x,wexx.C0.y,wexx.C0.z
  362. a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]=x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i)
  363. local x,y,z=wexx.C1:toEulerAnglesXYZ()
  364. a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]=xx2-(((xx2-rd(xx))/twa)*i),yy2-(((yy2-rd(yy))/twa)*i),zz2-(((zz2-rd(zz))/twa)*i)
  365. end
  366. end
  367. gunshot = function(speed,sc,dmg,cff) q(function()
  368. local bb = pa(workspace,"","Block",0.2*sc,0.3*sc,0.2*sc,true,true,0,0.1,"Black") qi({"CylinderMesh",bb})
  369. bb.CFrame = cff*ca(rd(rn(-1000,1000)/1500),rd(rn(-1000,1000)/1500),rd(rn(-1000,1000)/1500))
  370. so(ds.Fire,bb,0.3,1) wait() for i=1,50 do
  371. bhit,bpos=ray(bb.Position,bb.Position - (bb.CFrame *cn(0,-1,0)).p)
  372. if bhit and bpos and (bpos - bb.Position).magnitude < speed then break end
  373. bb.CFrame=bb.CFrame*cn(0,speed,0)*ca(rd(-0.2),0,0)
  374. wait()
  375. end bb.CFrame=bb.CFrame*cn(0,(bpos-bb.Position).magnitude,0)
  376. if not bhit.Anchored then
  377. if bhit.Parent:findFirstChild("Humanoid") then local h = bhit.Parent.Humanoid h.Health=h.Health-dmg so(ds.Hit,bhit,0.3,1) end
  378. else end bb:Remove()
  379. if bhit.Parent:findFirstChild("Humanoid") == nil then BulletHole(bpos,bhit,0.7*sc) end
  380. end) end
  381. _G.mm = qi({"Model",workspace,Name="RMTank"})
  382. local mm = _G.mm
  383. engine=pa(mm,"","Block",14,3,20,true,false,0,0,"Bright blue") it('BlockMesh',engine)
  384. engine.CFrame = c.Torso.CFrame*cn(0,0,-20)
  385. front=pa(mm,"","Wedge",14,3,3,true,false,0,0,"Bright blue")
  386. qi({"Weld",front,Part0=engine,Part1=front,C0=cn(0,0,-11.5)*ca(rd(180),rd(180),0)})
  387. front2=pa(mm,"","Wedge",14,2,6,true,false,0,0,"Bright blue")
  388. qi({"Weld",front,Part0=engine,Part1=front2,C0=cn(0,2.5,-10)})
  389. back=pa(mm,"","Wedge",14,5,6,true,false,0,0,"Bright blue")
  390. qi({"Weld",front,Part0=engine,Part1=back,C0=cn(0,1,13)*ca(rd(180),rd(0),0)})
  391. body2=pa(mm,"","Block",14,2,17,true,false,0,0,"Bright blue") it('BlockMesh',body2)
  392. qi({"Weld",body2,Part0=engine,Part1=body2,C0=cn(0,2.5,1.5)})
  393. body3=pa(mm,"","Wedge",14,1,8,true,false,0,0,"Bright blue")
  394. qi({"Weld",body2,Part0=engine,Part1=body3,C0=cn(0,4,12)})
  395. lbody=pa(mm,"","Block",2.3,3,24,true,false,0,0,"Bright blue") it('BlockMesh',lbody)
  396. qi({"Weld",body2,Part0=engine,Part1=lbody,C0=cn(8.1,2.5,1.5)})
  397. rbody=pa(mm,"","Block",2.3,3,24,true,false,0,0,"Bright blue") it('BlockMesh',rbody)
  398. qi({"Weld",body2,Part0=engine,Part1=rbody,C0=cn(-8.1,2.5,1.5)})
  399. lb=pa(mm,"","Block",2.25,0.4,18,true,false,0,0,"Black") it('BlockMesh',lb)
  400. qi({"Weld",body2,Part0=engine,Part1=lb,C0=cn(8,-2.5,1.5)})
  401. rb=pa(mm,"","Block",2.25,0.4,18,true,false,0,0,"Black") it('BlockMesh',lb)
  402. qi({"Weld",body2,Part0=engine,Part1=rb,C0=cn(-8,-2.5,1.5)})
  403. spi=pa(mm,"","Block",5,3,5,true,false,0,0,"Bright blue") it('CylinderMesh',spi)
  404. spiw = qi({"Weld",body2,Part0=engine,Part1=spi,C0=cn(0,5,5)})
  405. spi2=pa(mm,"","Block",12,3,12,true,false,0,0,"Bright blue") it('BlockMesh',spi2)
  406. qi({"Weld",body2,Part0=spi,Part1=spi2,C0=cn(0,1,0)})
  407. spi6=pa(mm,"","Wedge",12,3,2,true,false,0,0,"Bright blue") it('BlockMesh',spi2)
  408. qi({"Weld",body2,Part0=spi2,Part1=spi6,C0=cn(0,0,7)*ca(rd(180),rd(0),0)})
  409. spi3=pa(mm,"","Wedge",3,6,4,true,false,0,0,"Bright blue")
  410. qi({"Weld",body2,Part0=spi2,Part1=spi3,C0=cn(-3,0,-8)*ca(0,0,rd(90))})
  411. spi4=pa(mm,"","Wedge",3,6,4,true,false,0,0,"Bright blue")
  412. qi({"Weld",body2,Part0=spi2,Part1=spi4,C0=cn(3,0,-8)*ca(0,0,rd(-90))})
  413. tilt=pa(mm,"","Block",5,3,5,true,false,0,0,"Bright blue") it('CylinderMesh',tilt)
  414. tiltw=qi({"Weld",body2,Part0=spi2,Part1=tilt,C0=cn(0,0.5,-8.5)*ca(0,0,rd(90))})
  415. can=pa(mm,"","Block",2,20,2,true,false,0,0,"Bright blue") it('CylinderMesh',can)
  416. canw=qi({"Weld",body2,Part0=tilt,Part1=can,C0=cn(0,0,-11)*ca(rd(-90),0,0)})
  417. can2=pa(mm,"","Block",3.4,1.5,3.4,true,false,0,0,"Bright blue") it('CylinderMesh',can2)
  418. qi({"Weld",body2,Part0=can,Part1=can2,C0=cn(0,-4,0)})
  419. can5=pa(mm,"","Block",2.4,1.5,2.4,true,false,0,0,"Bright blue") it('CylinderMesh',can5)
  420. qi({"Weld",body2,Part0=can,Part1=can5,C0=cn(0,9,0)})
  421. can3=pa(mm,"","Block",2.5,10,2.5,true,false,0,0,"Bright blue") it('CylinderMesh',can3)
  422. qi({"Weld",body2,Part0=can,Part1=can3,C0=cn(0,-5,0)})
  423. can4=pa(mm,"","Block",3,4,3,true,false,0,0,"Bright blue") it('CylinderMesh',can4)
  424. qi({"Weld",body2,Part0=can,Part1=can4,C0=cn(0,1,0)})
  425. hol=pa(mm,"","Block",1.75,0,1.75,true,false,0,0,"Really black") it('CylinderMesh',hol)
  426. qi({"Weld",body2,Part0=can,Part1=hol,C0=cn(0,10,0)})
  427. smo = qi({"Smoke",hol,RiseVelocity=25,Size=8,Color=BrickColor.new("White").Color,Opacity=0.1,Enabled=false})
  428. hol2=pa(mm,"","Block",0,0,0,true,false,0,0,"Really black") it('CylinderMesh',hol2).Scale=v3(5,0.2,5)*5
  429. qi({"Weld",body2,Part0=spi2,Part1=hol2,C0=cn(0,1.5,4)})
  430. cap=pa(mm,"","Block",5.1,0,5.1,true,false,0,0,"Brick blue") it('CylinderMesh',cap)
  431. capw = qi({"Weld",body2,Part0=hol2,Part1=cap,C0=cn(0,0.1,2.5),C1=cn(0,0,2.5)})
  432. aaa=pa(mm,"","Block",3,0.5,0.5,true,false,0,0,"Brick blue")
  433. qi({"Weld",body2,Part0=hol2,Part1=aaa,C0=cn(0,0,2.5)})
  434. aaa2=pa(mm,"","Block",5,0.5,5,true,false,0,0,"Bright blue") it('CylinderMesh',aaa2)
  435. aaa2w=qi({"Weld",body2,Part0=spi2,Part1=aaa2,C0=cn(-3.4,1.7,-4.6)*ca(0,rd(35),0)})
  436. lb.Friction = 0.045
  437. rb.Friction = 0.045
  438. for x=-5,5,10/3 do
  439. aaax=pa(mm,"","Block",2,3.5,2,true,false,0,0,"")
  440. qi({"Weld",body2,Part0=spi2,Part1=aaax,C0=cn(x,0,7.5)*ca(rd(80),0,0)}) it('CylinderMesh',aaax)
  441. end
  442. for x=-1,1 do
  443. aaa=pa(mm,"","Block",x~=0 and 3 or 2,3,0.5,true,false,0,0,"Bright blue")
  444. qi({"Weld",body2,Part0=aaa2,Part1=aaa,C0=cn(x*2,1.6,x~=0 and -1 or -2)*ca(0,rd(-45*x),0)})
  445. if x==0 then
  446. ball=pa(mm,"","Block",0,0,0,true,false,0,0,"Bright blue") qi({"SpecialMesh",ball,MeshType="Sphere",Scale=v3(1.7,1,1)*7})
  447. ballw=qi({"Weld",body2,Part0=aaa,Part1=ball,C0=cn(0,1.5,0)})
  448. gun1=pa(mm,"","Block",0.5,2,0.5,true,false,0,0,"Bright blue") it('CylinderMesh',gun1)
  449. qi({"Weld",body2,Part0=ball,Part1=gun1,C0=cn(-0.4,0,-1)*ca(rd(-90),0,0)})
  450. gun2=pa(mm,"","Block",0.5,2,0.5,true,false,0,0,"Bright blue") it('CylinderMesh',gun2)
  451. qi({"Weld",body2,Part0=ball,Part1=gun2,C0=cn(0.4,0,-1)*ca(rd(-90),0,0)})
  452. for i,v in pairs({gun1,gun2}) do
  453. gunhol=pa(mm,"","Block",0.3,0,0.3,true,false,0,0,"Really black") it('CylinderMesh',gunhol)
  454. qi({"Weld",body2,Part0=v,Part1=gunhol,C0=cn(0,0.92,0)})
  455. end
  456. seat2=pa(mm,"","VehicleSeat",2,0.5,2,true,false,0,0,"Bright blue") it('CylinderMesh',seat2)
  457. seat2w=qi({"Weld",body2,Part0=aaa2,Part1=seat2,C0=cn(0,0.5,0)})
  458. seat2.HeadsUpDisplay=false
  459. q(function()
  460. local guntilt = 0
  461. for i,v in pairs({aaa2,ball,seat2}) do
  462. local gcd = qi({"ClickDetector",v,MaxActivationDistance=8})
  463. gcd.MouseClick:connect(function()
  464. gunshot(10,1,5,gun1.CFrame*cn(0,1+(rn(0,2000)/600),0))
  465. gunshot(10,1,5,gun2.CFrame*cn(0,1+(rn(0,2000)/600),0))
  466. end)
  467. end
  468. while true do if rn(1,8) == 1 then wait() else wait(0.0345) end
  469. aaa2w.C1=aaa2w.C1*ca(0,rd(seat2.Steer*6),0)
  470. if seat2.Throttle == 1 and guntilt<112 then guntilt = guntilt+4
  471. elseif seat2.Throttle == -1 and guntilt>-48 then guntilt=guntilt-4
  472. --elseif seat2.Throttle==0 then if guntilt > 0 then guntilt=guntilt-4 elseif guntilt<0 then guntilt=guntilt+4 end
  473. end
  474. ballw.C1=ca(rd(-guntilt),0,0)
  475. end
  476. end)
  477. end
  478. end
  479. for x=-1,1,2 do
  480. for z=-1,1,2 do
  481. whe=pa(mm,"","Block",4,2,4,true,false,0,0,"Black") qi({"CylinderMesh",whe})
  482. qi({"Weld",whe,Part0=engine,Part1=whe,C0=cn(x*8,0.8,(z*11.5)+1.5)*ca(0,0,rd(90))})
  483. ss=pa(mm,"","Block",2.25,0.3,5,true,false,0,0,"Black")
  484. qi({"Weld",body2,Part0=engine,Part1=ss,C0=cn(x*8,-1.5,(z*11.2)+1.5)*ca(rd(-23*z),0,0)})
  485. ss=pa(mm,"","Block",2.25,2,0.3,true,false,0,0,"Black")
  486. qi({"Weld",body2,Part0=engine,Part1=ss,C0=cn(x*8,0.4,(z*13.4)+1.5)})
  487. ss=pa(mm,"","Wedge",2.3,3,3,true,false,0,0,"Bright blue")
  488. local trolo = z == 1 and 180 or 0
  489. qi({"Weld",body2,Part0=engine,Part1=ss,C0=cn(x*8.1,2.5,(z*13.5)+1.5)*ca(0,rd(trolo),0)})
  490. end end
  491. local form = 4*4
  492. for x=-1,1,2 do
  493. for z=form/2,-form/2,-form/3 do
  494. whe=pa(mm,"","Block",4,2,4,true,false,0,0,"Black") qi({"CylinderMesh",whe})
  495. qi({"Weld",whe,Part0=engine,Part1=whe,C0=cn(8*x,-0.5,(z*0.9)+1.5)*ca(0,0,rd(90))})
  496. end
  497. end
  498. for i,p in pairs(mm:children()) do if p.BrickColor.Name=="Bright blue" then
  499. for i,s in pairs({"Back","Front","Bottom","Top","Left","Right"}) do
  500. --qi({"Texture",p,Face=s,Texture=ds.Camo,StudsPerTileU=0,StudsPerTileV=0})
  501. end
  502. end end
  503. game.Lighting.Ambient=Color3.new(1,1,1)
  504. local bin = qi({"HopperBin",bp,Name="RMTank"})
  505. t = {}
  506. t.Vault = "Closed"
  507. t.Steer = ""
  508. t.Steer2 = ""
  509. t.Steering=""
  510. t.Tilt = 0
  511. t.Move = ""
  512. t.Fire = false
  513. ks = {}
  514. TheWeld = nil
  515. Seated = false
  516. TankSpeed=16
  517. bv = qi({"BodyVelocity",engine}) bv.maxForce=v3(0,0,0)
  518. bav = qi({"BodyAngularVelocity",engine}) bav.maxTorque=v3(0,0,0)
  519. bin.Selected:connect(function(mouse)
  520. mouse.KeyDown:connect(function(k) k = k:lower() ks[k]=false
  521. if k == "g" and t.Vault~="moving" then if t.Vault=="Closed" then
  522. t.Vault = "moving" for i=0,-110,-10 do capw.C1=cn(0,0,2.5)*ca(rd(i),0,0) wait(0.034) end t.Vault="Opened" else
  523. t.Vault = "moving" for i=-110,0,10 do capw.C1=cn(0,0,2.5)*ca(rd(i),0,0) wait(0.034) end t.Vault="Closed" end
  524. elseif k == "h" and t.Steer=="" then t.Steer = "Left" repeat spiw.C1=spiw.C1*ca(0,rd(-2),0) wait(0.034) until ks[k] t.Steer = ""
  525. elseif k == "k" and t.Steer=="" then t.Steer = "Right" repeat spiw.C1=spiw.C1*ca(0,rd(2),0) wait(0.034) until ks[k] t.Steer = ""
  526. elseif k == "u" and t.Steer2=="" then t.Steer2 = "Up" repeat t.Tilt=t.Tilt+1.5 tiltw.C1=ca(0,rd(t.Tilt),0) wait(0.034) until t.Tilt>=90 or ks[k] t.Steer2 = ""
  527. elseif k == "j" and t.Steer2=="" then t.Steer2 = "Down" repeat t.Tilt=t.Tilt-1.5 tiltw.C1=ca(0,rd(t.Tilt),0) wait(0.034) until t.Tilt<=-12 or ks[k] t.Steer2 = ""
  528. elseif k == "z" and t.Vault=="Opened" and Seated and TheWeld then Seated = false TheWeld:Remove() c.Humanoid.PlatformStand = false c.Torso.CFrame = hol2.CFrame*cn(0,4,0) mm.Parent = workspace
  529. elseif k == "w" and Seated and t.Move == "" then t.Move = "Forward" bv.maxForce=v3(1/0,0,1/0) repeat bv.velocity=engine.CFrame.lookVector*TankSpeed wait() until ks[k] bv.maxForce=v3(0,0,0) t.Move = ""
  530. elseif k == "s" and Seated and t.Move == "" then t.Move = "Backward" bv.maxForce=v3(1/0,0,1/0) repeat bv.velocity=engine.CFrame.lookVector*(-TankSpeed/1.2) wait() until ks[k] bv.maxForce=v3(0,0,0) t.Move = ""
  531. elseif k == "a" and Seated and t.Steering=="" then t.Steering="Left" bav.maxTorque=v3(0,1/0,0) bav.angularvelocity=v3(0,0.8,0) repeat wait() until ks[k] bav.maxTorque=v3(0,0,0) t.Steering = ""
  532. elseif k == "d" and Seated and t.Steering=="" then t.Steering="Right" bav.maxTorque=v3(0,1/0,0) bav.angularvelocity=v3(0,-0.8,0) repeat wait() until ks[k] bav.maxTorque=v3(0,0,0) t.Steering = ""
  533. elseif k == "f" and not t.Fire then t.Fire = true
  534. q(function()
  535. GlowMesh(false,ds.Ring,hol,v3(7,7,7),'New Yeller',hol.CFrame*cn(0,0,0)*ca(rd(90),0,0),0.1,1,0.13)
  536. local speed = 8 local cff = hol.CFrame*cn(0,2,0) local dmg = 25
  537. local bb = pa(mm,"","Block",2,2,2,true,true,0,0.2,"Black") qi({"CylinderMesh",bb})
  538. local bb2 = pa(mm,"","Block",0,0,0,true,true,0,0.2,"Black") qi({"SpecialMesh",bb2,MeshType="Sphere",Scale=v3(2,3,2)*5})
  539. bb.CFrame = cff*ca(rd(rn(-1000,1000)/1500),rd(rn(-1000,1000)/1500),rd(rn(-1000,1000)/1500))
  540. so(ds.Fire,bb,0.3,1) wait() for i=1,50 do bb2.CFrame = bb.CFrame*cn(0,-5,0)
  541. bhit,bpos=ray(bb.Position,bb.Position - (bb.CFrame *cn(0,-1,0)).p)
  542. if bhit and bpos and (bpos - bb.Position).magnitude < speed then break end
  543. bb.CFrame=bb.CFrame*cn(0,speed,0)*ca(0,0,rd(0.2)) bb2.CFrame=bb.CFrame*cn(0,1,0)
  544. wait()
  545. end bb.CFrame=bb.CFrame*cn(0,(bpos-bb.Position).magnitude,0)
  546. bb:Remove() bb2:Remove()
  547. for i=1,3 do
  548. GlowMesh(false,"Sphere",hol,v3(rn(10,20),rn(10,20),rn(10,20)),'New Yeller',bb.CFrame*cn(rn(-3,3),rn(-3,3),rn(-3,3))*ca(rd(rn(-360,360)),rd(rn(-360,360)),rd(rn(-360,360))),0.1,1,0.1) end
  549. local rr = 10 GetRegion(bb.Position-v3(rr,rr,rr),bb.Position+v3(rr,rr,rr),function(v) if v.Name~="Torso" then return end v.Humanoid.Health=b.Humanoid.Health-dmg end,function(v) if v.Anchored or v:GetMass()>500 then return end v:BreakJoints() v.Velocity=cn(bb.Position,v.Position).lookVector*rn(70,120) end)
  550. end)
  551. smo.Enabled = true for i=0,-3,-1 do canw.C1=cn(0,-i/1.3,0) wait(0.033) end for i=-3,0,1 do canw.C1=cn(0,-i/1.3,0) wait(0.033) end
  552. smo.Enabled = false t.Fire = false
  553. end
  554. end)
  555. mouse.KeyUp:connect(function(k) k=k:lower() ks[k]=true
  556. end)
  557. end)
  558. hol2.Touched:connect(function(hit) if hit.Parent ~= c or Seated or t.Vault~="Opened" then return end
  559. _G.mm.Parent = c Seated = true
  560. local hu = c.Humanoid hu.PlatformStand = true wait()
  561. TheWeld = qi({"Weld",engine,Part0=engine,Part1=c.Torso,C0=cn(0,1.5,2)*ca(rd(90),0,0)})
  562. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement