Advertisement
lafur

Untitled

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