Laith8888

Grenade Launcher script

Feb 6th, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.15 KB | None | 0 0
  1. script.Parent = nil
  2. it = Instance.new
  3. v3=Vector3.new
  4. bc=BrickColor.new
  5. c3=Color3.new
  6. cn=CFrame.new
  7. ca=CFrame.Angles
  8. ca2=function(a,b,c)
  9. return ca(math.rad(a),math.rad(b),math.rad(c))
  10. end
  11. ti=table.insert
  12. tr=table.remove
  13. rn=math.random
  14. rd=math.rad
  15. mf=math.floor
  16. ud = UDim2.new
  17. inf=math.huge
  18. dg=math.deg
  19. mdeg=math.deg
  20. v310=v3(1/0,1/0,1/0)
  21. pi=math.pi
  22. w=wait
  23. cf=cn
  24. bn=bc
  25. ts=tostring
  26. Workspace=game:GetService("Workspace")
  27. Players=game:GetService("Players")
  28. Player=Players.LocalPlayer
  29. Lighting=game:GetService("Lighting")
  30. Debris=game:GetService("Debris")
  31. work=Workspace
  32. server=Players
  33. tb=Player
  34. lighting=Lighting
  35. deb=Debris
  36. asset = "http://www.roblox.com/asset/?id="
  37. Asset=asset
  38. ids = {}
  39. ids.Shoot = 10209633
  40. ids.Reload = 10209636
  41. ids.Crown = 20329976
  42. ids.Crown2 = 1323306
  43. ids.Icon = 52611635
  44. ids.Explode = 2697431
  45. ids.Ring = 3270017
  46. for i,v in pairs(ids) do
  47. if type(v)=='number' then
  48. ids[i]='http://www.roblox.com/asset/?id='..v
  49. end
  50. game:GetService("ContentProvider"):Preload(ids[i])
  51. end
  52. qi = function(ttz)
  53. local qii = it(ttz[1]) table.foreach(ttz,function(oi,oi2)
  54. if oi ~= 1 and oi ~= 2 then qii[oi] = oi2 end end) qii.Parent=ttz[2] return qii end
  55. q = function(f)
  56. coroutine.resume(coroutine.create(function() f() end)) end
  57. ft = function(tablez,item)
  58. for i=1,#tablez do if tablez[i] == item then return i end end return nil end
  59. ft2 = function(tablez,item)
  60. for i=1,#tablez do if tablez[i][1] == item then return i end end return nil end
  61. pa = function(pa,pn,sh,x,y,z,c,a,tr,re,bc2)
  62. local fp=nil
  63. if sh ~= "Wedge" and sh ~= "CornerWedge" and sh ~= "VehicleSeat" and sh ~= "Seat" then
  64. fp=it("Part",pa)
  65. fp.Shape=sh or "Block"
  66. fp.formFactor="Custom"
  67. elseif sh == "Wedge" then
  68. fp=it("WedgePart",pa)
  69. fp.formFactor="Custom"
  70. elseif sh == "CornerWedge" then
  71. fp=it("CornerWedgePart",pa)
  72. elseif sh == "VehicleSeat" then
  73. fp=it("VehicleSeat",pa)
  74. elseif sh == "Seat" then
  75. fp=it("Seat",pa)
  76. end
  77. fp.Size=v3(x or 4,y or 2,z or 2)
  78. fp.Friction = 2
  79. fp.CanCollide=c or true
  80. fp.Anchored=a or false
  81. fp.BrickColor=bc(bc2 or "")
  82. fp.Transparency=tr or 0
  83. fp.Reflectance=re or 0
  84. fp.BottomSurface=0
  85. fp.Name=pn or "TBLib Part"
  86. fp.Locked = true
  87. fp.TopSurface=0
  88. fp.CFrame=cn(0,0,0)
  89. fp:BreakJoints()
  90. fp.Anchored = a
  91. return fp
  92. end
  93. function ClearClass(Object,Class)
  94. for _,v in pairs(Object:GetChildren()) do
  95. if v:IsA(Class) then
  96. v:Destroy()
  97. end
  98. end
  99. end
  100. function GetClass(Object,Class)
  101. for _,v in pairs(Object:GetChildren()) do
  102. if v:IsA(Class) then
  103. return v
  104. end
  105. end
  106. end
  107. function re(par,obj)
  108. if par:findFirstChild(obj) then
  109. par[obj]:Remove''
  110. end
  111. end
  112. function invis(o)
  113. for i,v in pairs(o:children()) do
  114. if v:IsA("BasePart") then
  115. v.Transparency=1
  116. end
  117. invis(v)
  118. end
  119. end
  120. function newhats(p,o,o2)
  121. for i,v in pairs(p:children()) do
  122. if v:IsA("Hat") then
  123. local np=v.Handle:Clone''
  124. np.Transparency=0
  125. np.Mesh.Scale=np.Mesh.Scale*1.04
  126. np.Parent=o
  127. np.CFrame=v.Handle.CFrame
  128. np.Name="Hat"
  129. stick2(np,o2,o)
  130. end
  131. end
  132. end
  133. fade = function(prt,incr)
  134. q(function()
  135. for i=prt.Transparency,1,incr do
  136. prt.Transparency=i
  137. wait()
  138. end
  139. prt:Remove''
  140. end)
  141. end
  142. function weld(pa,p0,p1,x,y,z,a,b,c)
  143. local fw=it("Weld",pa)
  144. fw.Part0=p0
  145. fw.Part1=p1
  146. fw.C0=cn(x,y,z)*ca(a,b,c)
  147. return fw
  148. end
  149. stick = function(hit2,hit)
  150. return qi({"Weld",hit2,Part0=hit2,Part1=hit,C0=hit2.CFrame:inverse()*cn(hit2.Position),C1=hit.CFrame:inverse()*cn(hit2.Position)})
  151. end
  152. function stick2(hit2,hit,tostick)
  153. local weld=it("Weld")
  154. weld.Part0=tostick
  155. weld.Part1=hit2
  156. local HitPos=hit.Position
  157. local CJ=cn(HitPos)
  158. local C0=hit2.CFrame:inverse() *CJ
  159. local C1=hit.CFrame:inverse() * CJ weld.C0=C1
  160. weld.C1=C0
  161. weld.Parent=hit2
  162. end
  163. ray = function(Pos, Dir,tab)
  164. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit *999),tab)
  165. end
  166. function rtab(tabz,obj)
  167. for i=1,#tabz do
  168. if tabz[i] == obj then
  169. tr(tabz,i)
  170. break
  171. end
  172. end
  173. end
  174. sTrail={}
  175. function Trail2(lopz,ob,waitz,col,thickz,ofz) cw(function() ti(sTrail,ob)
  176. local oldpos=(ob.CFrame *ofz).p local lopz2=0
  177. local function loltr() local obp=(ob.CFrame *ofz).p lopz2=lopz2 + 1
  178. local mag=(oldpos - obp).magnitude
  179. local tr=pa(ob,"trail","Block",0,0,0,false,false,0.5,0.15,col) tr.Anchored=true
  180. tr.CFrame=cn(oldpos,obp)
  181. tr.CFrame=tr.CFrame + tr.CFrame.lookVector* (mag/2)
  182. local trm=it("CylinderMesh",tr) trm.Scale=v3(5*thickz,mag*5,5*thickz)
  183. cw(function() for i=5*thickz,0,-5*thickz/10 do trm.Scale=v3(i,mag*5,i) w() end tr:Remove'' end)
  184. tr.CFrame=tr.CFrame *ca(rd(90),0,0) oldpos=obp end
  185. repeat loltr()
  186. wait(waitz) until ft(sTrail,ob) == nil or lopz2 == lopz loltr() end) end
  187. Trail = function(ob,times,waitz,col,thickz,ofz) -- Brick Trail
  188. q(function()
  189. local oldpos=(ob.CFrame *ofz).p
  190. for i=1,times do
  191. if effon==true then
  192. local obp=(ob.CFrame *ofz).p
  193. local mag=(oldpos - obp).magnitude
  194. local tr=pa(ob,"trail","Block",0,0,0,false,false,0.5,0.15,col)
  195. tr.Anchored=true
  196. tr.CFrame=cn(oldpos,obp)
  197. tr.CFrame=tr.CFrame + tr.CFrame.lookVector* (mag/2)
  198. trm=it("CylinderMesh",tr)
  199. trm.Scale=v3(thickz,mag*5,thickz)
  200. q(function()
  201. for i=thickz,0,thickz/10 do
  202. trm.Scale=v3(i,mag*5,i)
  203. wait()
  204. end
  205. tr:Remove''
  206. end)
  207. tr.CFrame=tr.CFrame *ca(rd(90),0,0)
  208. oldpos=obp wait(waitz)
  209. end
  210. end
  211. end)
  212. end
  213. de = function(it,ti) game:service'Debris':AddItem(it,ti) end -- Debris
  214. GlowMesh = function(anch,meshid2,rootz,mv3,colzz,adjus,l1,l2,l3) q(function() -- Glowmesh
  215. local spi=pa(rootz,"glowmesh","Block",mv3.X,mv3.Y,mv3.Z,false,false,l1,0,colzz) local spim=it("SpecialMesh",spi) spi.CanCollide=false if meshid2:lower()=="sphere" then spim.MeshType="Sphere" elseif meshid2:lower()=="block" then spim=it("BlockMesh",spi) else spim.MeshType="FileMesh" spim.MeshId=meshid2 end
  216. 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
  217. for i=l1,l2,l3 do spi.Transparency=i spim.Scale=mv3*(i+0.3) wait() end spi:Remove'' end)
  218. end
  219. DetectSurface = function(pos, part) -- Surface Detector
  220. local surface = nil local pospos = part.CFrame
  221. local pos2 = pospos:pointToObjectSpace(pos) local siz = part.Size local shaep = part.Shape
  222. if shaep == Enum.PartType.Ball or shaep == Enum.PartType.Cylinder then
  223. surface = {"Anything", cn(pospos.p, pos)*cn(0, 0, -(pospos.p - pos).magnitude+0.12)*ca(rd(-90), 0, 0)}
  224. else if pos2.Y > ((siz.Y/2)-0.01) then surface = {"Top", ca(0, 0, 0)}
  225. elseif pos2.Y < -((siz.Y/2)-0.01) then surface = {"Bottom", ca(-math.pi, 0, 0)} elseif pos2.X > ((siz.X/2)-0.01) then surface = {"Right", ca(0, 0, rd(-90))}
  226. elseif pos2.X < -((siz.X/2)-0.01) then surface = {"Left", ca(0, 0, rd(90))} elseif pos2.Z > ((siz.Z/2)-0.01) then surface = {"Back", ca(rd(90), 0, 0)} elseif pos2.Z < -((siz.Z/2)-0.01) then surface = {"Front", ca(rd(-90), 0, 0)} end end return surface end
  227. BulletHole = function(HitPos,HitObj,sc,img,par) -- Bullethole function
  228. local Surface = DetectSurface(HitPos, HitObj)
  229. local C = cn(HitPos) * ca(HitObj.CFrame:toEulerAnglesXYZ()) * Surface[2]
  230. if Surface[1] == "Anything" then C = Surface[2] end local theimg = img or ds.BulletHole
  231. local bl = pa(workspace or par,"bullethole","Block",sc,0,sc,false,true,1,0,"") qi({"Decal",bl,Face="Top",Texture=theimg})
  232. 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 q(function() wait(5) for i=0,1,0.05 do bl.Size=v3(-i*sc,0,-i*sc) wait() end de(bl,0) end)
  233. end
  234. so = function(id,par,vol,pit) q(function() -- Sound maker
  235. local sou = qi({"Sound",par or workspace,Volume=vol,Pitch=pit or 1,SoundId=id})
  236. wait() sou:play() wait(6) sou:Remove() end) end
  237. -- local/so(asset..ds.GothicMusic,workspace,1,2.6)
  238. function GetRegion(p0,p1,f,f2) q(function()
  239. for i,v in pairs(workspace:FindPartsInRegion3(Region3.new(p0,p1),c,100) ) do if v.Parent:findFirstChild("Humanoid") and v.Parent.Humanoid.Health > 0 and v.Parent:findFirstChild("Torso") then q(function() f(v.Parent) end) elseif f2 and v.Parent.Parent:findFirstChild("Humanoid") == nil then f2(v) end end
  240. end) end
  241. FindGround = function(pos) -- ground finder
  242. local ax,ay,az = pos:toEulerAnglesXYZ()
  243. local bhit,bpos=ray(pos.p,pos.p - (pos.p + v3(0,200,0)))
  244. if bhit and bpos then
  245. return cn(bpos)*ca(ax,ay,az)
  246. end
  247. return nil
  248. end
  249. function NPC(Name, Position) -- npc maker
  250. local Character = Instance.new("Model")
  251. Character.Name = Name
  252. local Humanoid = Instance.new("Humanoid")
  253. Humanoid.Parent = Character
  254. local Template = Instance.new("Part")
  255. Template.FormFactor = "Custom"
  256. Template.Size = Vector3.new(1, 2, 1)
  257. Template.Locked = true
  258. local Head = Template:Clone()
  259. Head.Name = "Head"
  260. Head.TopSurface = "Smooth"
  261. Head.BottomSurface = "Smooth"
  262. Head.Size = Vector3.new(2, 1, 1)
  263. Head.Parent = Character
  264. local Mesh = Instance.new("SpecialMesh")
  265. Mesh.MeshType = "Head"
  266. Mesh.Scale = Vector3.new(1.25, 1.25, 1.25)
  267. Mesh.Parent = Head
  268. local Face = Instance.new("Decal")
  269. Face.Name = "face"
  270. Face.Texture = "rbxasset://textures/face.png"
  271. Face.Parent = Head
  272. local Torso = Template:Clone()
  273. Torso.Name = "Torso"
  274. Torso.LeftSurface = "Weld"
  275. Torso.RightSurface = "Weld"
  276. Torso.CFrame = CFrame.new(0, 10000, 0)
  277. Torso.Size = Vector3.new(2, 2, 1)
  278. Torso.Parent = Character
  279. local TShirt = Instance.new("Decal")
  280. TShirt.Name = "roblox"
  281. TShirt.Parent = Torso
  282. local LeftArm = Template:Clone()
  283. LeftArm.Name = "Left Arm"
  284. LeftArm.Parent = Character
  285. local RightArm = Template:Clone()
  286. RightArm.Name = "Right Arm"
  287. RightArm.Parent = Character
  288. local LeftLeg = Template:Clone()
  289. LeftLeg.Name = "Left Leg"
  290. LeftLeg.Parent = Character
  291. local RightLeg = Template:Clone()
  292. RightLeg.Name = "Right Leg"
  293. RightLeg.Parent = Character
  294. Character:BreakJoints()
  295. local Neck = Instance.new("Weld")
  296. Neck.Name = "Neck"
  297. Neck.Part0 = Torso
  298. Neck.Part1 = Head
  299. Neck.C0 = CFrame.new(0, 1.5, 0)
  300. Neck.Parent = Torso
  301. local LeftShoulder = Instance.new("Motor")
  302. LeftShoulder.Name = "Left Shoulder"
  303. LeftShoulder.Part0 = Torso
  304. LeftShoulder.Part1 = LeftArm
  305. LeftShoulder.MaxVelocity = 0.1
  306. LeftShoulder.C0 = CFrame.new(-Torso.Size.x / 2 - RightArm.Size.x / 2, LeftArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, -math.pi / 2, 0)
  307. LeftShoulder.C1 = CFrame.new(0, LeftArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, -math.pi / 2, 0)
  308. LeftShoulder.Parent = Torso
  309. local RightShoulder = Instance.new("Motor")
  310. RightShoulder.Name = "Right Shoulder"
  311. RightShoulder.Part0 = Torso
  312. RightShoulder.Part1 = RightArm
  313. RightShoulder.MaxVelocity = 0.1
  314. RightShoulder.C0 = CFrame.new(Torso.Size.x / 2 + RightArm.Size.x / 2, RightArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
  315. RightShoulder.C1 = CFrame.new(0, RightArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
  316. RightShoulder.Parent = Torso
  317. local LeftHip = Instance.new("Motor")
  318. LeftHip.Name = "Left Hip"
  319. LeftHip.Part0 = Torso
  320. LeftHip.Part1 = LeftLeg
  321. LeftHip.MaxVelocity = 0.1
  322. LeftHip.C0 = CFrame.new(-LeftLeg.Size.x / 2, -LeftLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, -math.pi / 2, 0)
  323. LeftHip.C1 = CFrame.new(0, LeftLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, -math.pi / 2, 0)
  324. LeftHip.Parent = Torso
  325. local RightHip = Instance.new("Motor")
  326. RightHip.Name = "Right Hip"
  327. RightHip.Part0 = Torso
  328. RightHip.Part1 = RightLeg
  329. RightHip.MaxVelocity = 0.1
  330. RightHip.C0 = CFrame.new(RightLeg.Size.x / 2, -RightLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
  331. RightHip.C1 = CFrame.new(0, RightLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
  332. RightHip.Parent = Torso
  333. local BodyColors = Instance.new("BodyColors")
  334. BodyColors.LeftArmColor = BrickColor.new("Bright yellow")
  335. BodyColors.RightArmColor = BrickColor.new("Bright yellow")
  336. BodyColors.LeftLegColor = BrickColor.new("Br. yellowish green")
  337. BodyColors.RightLegColor = BrickColor.new("Br. yellowish green")
  338. BodyColors.HeadColor = BrickColor.new("Bright yellow")
  339. BodyColors.TorsoColor = BrickColor.new("Bright blue")
  340. BodyColors.Parent = Character
  341. Character.Parent = Workspace
  342. Character:MoveTo(Position)
  343. Character:MoveTo(Torso.Position + Vector3.new(0, 3, 0))
  344. return Character
  345. end
  346. AddBV=function(str,cfr,par,debt)
  347. if not par then return end
  348. if par:findFirstChild'LibBV' then par.LibBV:Remove() end
  349. tbbodyvelocity=qi{'BodyVelocity',par,velocity=cfr.lookVector*str,maxForce=v3(1/0,1/0,1/0),Name='LibBV'} deb:AddItem(tbbodyvelocity,debt)
  350. end
  351. AddBG=function(str,par,debt)
  352. if not par then return end
  353. if par:findFirstChild'LibBG' then par.LibBG:Remove() end
  354. tbbodygyro=qi{'BodyGyro',par,maxTorque=v3(1/0,1/0,1/0),P=100000,cframe=str,Name='LibBG'} deb:AddItem(tbbodygyro,debt)
  355. end
  356. AddBAV=function(vec3,par,debt)
  357. if not par then return end
  358. if par:findFirstChild'LibBAV' then par.LibBAV:Remove() end
  359. tbbodyangularvelocity=qi{'BodyAngularVelocity',par,maxTorque=v3(1/0,1/0,1/0),angularvelocity=vec3,Name='LibBAV'} deb:AddItem(tbbodyangularvelocity,debt)
  360. end
  361. Dmg = function(Hum,Dealt,Critical)
  362. local HM=Hum.Parent
  363. local HMT,HMB=HM:findFirstChild'Torso',HM:findFirstChild'Block'
  364. local Blocks=HMB and HMB.Value>0
  365. if HMT then
  366. local mm=qi{'Model',HMT} qi{'Humanoid',mm,MaxHealth=0} deb:AddItem(mm,1)
  367. local mp= qi{'Part',mm,Name='Head',formFactor="Custom",Anchored=true,CanCollide=false,Size=v3(1,0.2,1),CFrame=HMT.CFrame*cn(rn(-100,100)/50,3,rn(-100,100)/50)} qi{'BlockMesh',mp}
  368. if Blocks then
  369. mm.Name='Block!'
  370. mp.BrickColor=bn'Bright blue'
  371. HMB.Value=HMB.Value-1
  372. elseif not Blocks then
  373. mm.Name=Dealt
  374. mp.BrickColor=bn'Bright red'
  375. end
  376. end
  377. if not Blocks then
  378. Hum:TakeDamage(Dealt)
  379. end
  380. end
  381. GetHum = function(part)
  382. local Hum,HT,block
  383. for i,v in pairs(part.Parent:children()) do
  384. if v:IsA("Humanoid") then
  385. Hum=v
  386. elseif v.Name=='Torso' then
  387. HT=v
  388. elseif v.Name=='Block' and v:IsA("NumberValue") then
  389. block=v
  390. end
  391. end
  392. return Hum,HT,block
  393. end
  394. Lightning = function(p0,p1,tym,ofs,col,th,tra) -- start end times offset color thickness
  395. local magz = (p0 - p1).magnitude local curpos = p0 local trz = {-ofs,ofs}
  396. for i=1,tym do
  397. local li = it("Part",c) li.TopSurface =0 li.BottomSurface = 0 li.Anchored = true li.Transparency = tra or 0.4 li.BrickColor = bc(col)
  398. li.formFactor = "Custom" li.CanCollide = false li.Size = v3(th,th,magz/tym) local ofz = v3(trz[rn(1,2)],trz[rn(1,2)],trz[rn(1,2)])
  399. local trolpos = cn(curpos,p1)*cn(0,0,magz/tym).p+ofz
  400. if tym == i then
  401. local magz2 = (curpos - p1).magnitude li.Size = v3(th,th,magz2)
  402. li.CFrame = cn(curpos,p1)*cn(0,0,-magz2/2)
  403. else
  404. li.CFrame = cn(curpos,trolpos)*cn(0,0,magz/tym/2)
  405. end
  406. curpos = li.CFrame*cn(0,0,magz/tym/2).p de(li,0.25)
  407. end
  408. end
  409. MakeCrater = function(pos,sc,tyms,debz,par) -- crater maker
  410. q(function()
  411. if not debz then
  412. debz = 5
  413. end
  414. local bhit,bpos=ray(pos,pos - (pos + v3(0,200,0)))
  415. if bhit and bpos then
  416. for i=1,tyms do
  417. q(function()
  418. local gr = pa(par or workspace,"","Block",rn(5,13)/10*sc,0.25*sc,rn(4,10)/10*sc,true,true,bhit.Transparency,bhit.Reflectance,bhit.BrickColor.Name)
  419. gr.Material = bhit.Material
  420. gr.TopSurface = bhit.TopSurface
  421. 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)))
  422. wait(debz)
  423. fade(gr,0.1)
  424. end)
  425. end
  426. end
  427. end)
  428. end
  429. MakeCrack = function(pos,sc,debz,par) -- crackmaker
  430. q(function()
  431. if not debz then
  432. debz = 5
  433. end
  434. local bhit,bpos=ray(pos,pos - (pos + v3(0,10,0)))
  435. if bhit and bpos then
  436. local cr = pa(par or workspace,"Crack","Block",sc,0,sc,false,true,1,0,"") cr.CFrame = cn(bpos)
  437. local dec=qi({"Decal",cr,Face="Top",Texture=ds.Crack}) de(cr,debz)
  438. end
  439. end)
  440. end
  441. a = {}
  442. a.insw={}
  443. function cleanweld(wexx,namzi)
  444. local tn=ft2(a.insw,wexx)
  445. if tn==nil then return end
  446. if namzi=="p0" then
  447. a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]=0,0,0 elseif namzi=="p1" then
  448. a.insw[tn][2]["p1x"],a.insw[tn][2]["p1y"],a.insw[tn][2]["p1z"]=0,0,0 elseif namzi=="a0" then
  449. a.insw[tn][2]["a0x"],a.insw[tn][2]["a0y"],a.insw[tn][2]["a0z"]=0,0,0 elseif namzi=="a1" then
  450. a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]=0,0,0
  451. end
  452. end
  453. function c2(wexx,smmx,c0orc1,aa,bb,cc,xx,yy,zz)
  454. q(function()
  455. c1(wexx,smmx,c0orc1,aa,bb,cc,xx,yy,zz)
  456. end)
  457. end
  458. a.Welding=0
  459. function c1(wexx,smmx,c0orc1,aa,bb,cc,xx,yy,zz)
  460. if ft2(a.insw,wexx)==nil then
  461. ti(a.insw,{wexx,{}})
  462. local tn=ft2(a.insw,wexx)
  463. a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]=wexx.C0.x,wexx.C0.y,wexx.C0.z
  464. a.insw[tn][2]["p1x"],a.insw[tn][2]["p1y"],a.insw[tn][2]["p1z"]=wexx.C1.x,wexx.C1.y,wexx.C1.z
  465. a.insw[tn][2]["a0x"],a.insw[tn][2]["a0y"],a.insw[tn][2]["a0z"]=wexx.C0:toEulerAnglesXYZ()
  466. a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]=wexx.C1:toEulerAnglesXYZ()
  467. end
  468. local tn=ft2(a.insw,wexx)
  469. local xx2,yy2,zz2=0,0,0
  470. local x2,y2,z2=0,0,0
  471. if c0orc1==0 then
  472. xx2,yy2,zz2=a.insw[tn][2]["a0x"],a.insw[tn][2]["a0y"],a.insw[tn][2]["a0z"]
  473. x2,y2,z2=a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]
  474. elseif c0orc1==1 then
  475. xx2,yy2,zz2=a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]
  476. x2,y2,z2=a.insw[tn][2]["p1x"],a.insw[tn][2]["p1y"],a.insw[tn][2]["p1z"]
  477. else
  478. xx2,yy2,zz2=a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]
  479. x2,y2,z2=a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]
  480. end a.Welding=a.Welding + 1
  481. local twa=1
  482. if smmx >= 1 then
  483. else
  484. for i=smmx,0.8,smmx do
  485. twa = 1
  486. if c0orc1==0 then
  487. 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))
  488. elseif c0orc1==1 then
  489. 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))
  490. else local x,y,z = wexx.C0:toEulerAnglesXYZ()
  491. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i))*ca(x,y,z)
  492. 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))
  493. end
  494. if fu then
  495. q(fu)
  496. end
  497. wait()
  498. end
  499. for i=0.8,1,smmx*0.45 do
  500. twa = 1
  501. if c0orc1==0 then
  502. 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))
  503. elseif c0orc1==1 then
  504. 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))
  505. else local x,y,z = wexx.C0:toEulerAnglesXYZ()
  506. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i))*ca(x,y,z)
  507. 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))
  508. end
  509. wait()
  510. end
  511. end
  512. local i=1
  513. if c0orc1==0 then
  514. 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))
  515. elseif c0orc1==1 then
  516. 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))
  517. else local x,y,z = wexx.C0:toEulerAnglesXYZ()
  518. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i))*ca(x,y,z)
  519. 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))
  520. end
  521. a.Welding=a.Welding - 1
  522. local tn=ft2(a.insw,wexx)
  523. if c0orc1==0 then
  524. 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)
  525. 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)
  526. elseif c0orc1==1 then
  527. 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)
  528. 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)
  529. elseif c0orc1==3 then
  530. local x,y,z=wexx.C0.x,wexx.C0.y,wexx.C0.z
  531. 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)
  532. local x,y,z=wexx.C1:toEulerAnglesXYZ()
  533. 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)
  534. end
  535. end
  536. Welds={}
  537. Ani=function(w,a,b,c,d,e,f,ty,inc,sined)
  538. if not Welds[w] then
  539. local d0,e0,f0=w.C0:toEulerAnglesXYZ() local d1,e1,f1=w.C1:toEulerAnglesXYZ()
  540. local d0,e0,f0=mdeg(d0),mdeg(e0),mdeg(f0) local d1,e1,f1=mdeg(d1),mdeg(e1),mdeg(f1)
  541. Welds[w]={[0]={w.C0.x,w.C0.y,w.C0.z,d0,e0,f0},[1]={w.C1.x,w.C1.y,w.C1.z,d1,e1,f1}}
  542. end
  543. local c0,c1=Welds[w][0],Welds[w][1]
  544. c0[1],c0[2],c0[3]=w.C0.x,w.C0.y,w.C0.z
  545. c1[1],c1[2],c1[3]=w.C1.x,w.C1.y,w.C1.z
  546. local A0,B0,C0,D0,E0,F0 = unpack(c0)
  547. local A1,B1,C1,D1,E1,F1 = unpack(c1)
  548. local Do = function(i)
  549. if ty==0 then
  550. w.C0=cn( A0-((A0-a)*i) , B0-((B0-b)*i) , C0-((C0-c)*i) ) * ca2( D0-((D0-d)*i) , E0-(((E0-e)/1)*i) , F0-((F0-f)*i) )
  551. elseif ty==1 then
  552. w.C1=cn( A1-((A1-a)*i) , B1-((B1-b)*i) , C1-((C1-c)*i) ) * ca2( D1-((D1-d)*i) , E1-(((E1-e)/1)*i) , F1-((F1-f)*i) )
  553. else
  554. w.C0=cn( A0-((A0-a)*i) , B0-((B0-b)*i) , C0-((C0-c)*i) ) * ca2(D0,E0,F0)
  555. w.C1=cn(A1,B1,C1) * ca2( D1-((D1-d)*i) , E1-(((E1-e)/1)*i) , F1-((F1-f)*i) )
  556. end
  557. end
  558. for i=inc,1,inc do
  559. Do(sined and math.sin(math.pi/2*i) or i)
  560. wait()
  561. end
  562. Do(1)
  563. if ty==0 then
  564. c0[4],c0[5],c0[6]=d,e,f
  565. else
  566. c1[4],c1[5],c1[6]=d,e,f
  567. end
  568. end
  569. qAni=function(w,a,b,c,d,e,f,ty,inc,sined) q(function() Ani(w,a,b,c,d,e,f,ty,inc,sined) end) end
  570. rAni=function(w)
  571. Welds[w]=nil
  572. end
  573. gunshot = function(speed,sc,dmg,cff) q(function() -- gunshot function
  574. local bb = pa(workspace,"bullet","Block",0.2*sc,0.3*sc,0.2*sc,true,true,0,0.1,"Black") qi({"CylinderMesh",bb})
  575. bb.CFrame = cff*ca(rd(rn(-1000,1000)/1500),rd(rn(-1000,1000)/1500),rd(rn(-1000,1000)/1500))
  576. so(ds.Fire,bb,0.3,1) wait() for i=1,50 do
  577. bhit,bpos=ray(bb.Position,bb.Position - (bb.CFrame *cn(0,-1,0)).p)
  578. if bhit and bhit.Name ~= "bullet" and bhit.Name ~= "bullethole" and bpos and (bpos - bb.Position).magnitude < speed then break end
  579. bb.CFrame=bb.CFrame*cn(0,speed,0)*ca(rd(-0.2),0,0)
  580. wait()
  581. end bb.CFrame=bb.CFrame*cn(0,(bpos-bb.Position).magnitude,0)
  582. if not bhit.Anchored then
  583. if bhit.Parent:findFirstChild("Humanoid") then local h = bhit.Parent.Humanoid h.Health=h.Health-dmg so(ds.Hit,bhit,0.3,1) end
  584. else if bhit.Name~="Base" then bhit.Anchored=false bhit:BreakJoints() end end bb:Remove()
  585. if bhit.Parent:findFirstChild("Humanoid") == nil then BulletHole(bpos,bhit,0.7*sc) end
  586. end) end
  587. dive = function(ob2,pro,ite,stof)
  588. local function div(ob) for i,v in pairs(ob:children()) do if v[pro] == ite then
  589. for i=1,#stof do v[stof[i][1]] = stof[i][2] end else div(v) end end end
  590. div(ob2)
  591. end
  592. fc = function(ob,cl)
  593. for i,v in pairs(ob:children()) do if v.className:lower()==cl:lower() then return v end end
  594. end
  595. function se(Key,Text)
  596. local Values = {}
  597. for value in (Text..Key):gmatch("(.-)"..Key) do
  598. table.insert(Values,value)
  599. end return Values
  600. end
  601. local thefenv = getfenv()
  602. getfenv()["rmhelp"] = function()
  603. local nus = 0
  604. for i,v in pairs(thefenv) do if i ~= "wait" and i ~= "script" then nus = nus + 1 wait(0.05)
  605. print(string.rep(" ",3-#tostring(nus)) ..nus.. ") " ..i.. " (" ..type(v).. ")")
  606. end
  607. end
  608. end
  609. for i,v in pairs(thefenv) do
  610. _G[i] = v
  611. --print(i)
  612. end
  613. _G[" r".."m".."d".."x "] = [[
  614. for i,v in pairs(_G) do
  615. if i ~= "wait" and i ~= "script" then
  616. getfenv()[i] = v
  617. end
  618. end
  619. ]]
  620. script:ClearAllChildren()
  621. loadstring(_G[" rmdx "])()
  622. Player=game:GetService("Players").LocalPlayer
  623. Char=Player.Character
  624. Backpack=Player.Backpack
  625. PlayerGui=Player.PlayerGui
  626. Torso=Char.Torso
  627. Head=Char.Head
  628. Hum=Char.Humanoid
  629. Cam=workspace.CurrentCamera
  630. Tn="Pipebomb Launcher"
  631. pcall(function() Backpack[Tn]:Remove() end)
  632. pcall(function() Cam[Tn]:Remove() end)
  633. pcall(function() thesuit=Char[''] end)
  634. pcall(function() thesuit[Tn]:Remove() end)
  635. pcall(function() PlayerGui[Tn]:Remove() end)
  636. CModel=qi{'Model',Cam,Name=Tn}
  637. Tool=qi{'HopperBin',Player.Backpack,Name=Tn}
  638. Suit=qi{'Model',Char,Name=''}
  639. Weapon=qi{'Model',Suit,Name=Tn}
  640. Gui=qi{'ScreenGui',PlayerGui,Name=Tn}
  641. equip="unequipped"
  642. anim=""
  643. keys={}
  644. fmouse=nil
  645. PipeRotate=0
  646. Clip=6
  647. LastShot=0
  648. ids = {}
  649. ids.Shoot = 10209633
  650. ids.Reload = 10209636
  651. ids.Crown = 20329976
  652. ids.Crown2 = 1323306
  653. ids.Icon = 52611635
  654. ids.Explode = 2697431
  655. ids.Ring = 3270017
  656. for i,v in pairs(ids) do
  657. if type(v)=='number' then
  658. ids[i]='http://www.roblox.com/asset/?id='..v
  659. end
  660. game:GetService("ContentProvider"):Preload(ids[i])
  661. end
  662. Limbs={LS=Torso:findFirstChild'Left Shoulder',RS=Torso:findFirstChild'Right Shoulder',LH=Torso:findFirstChild'Left Hip',RH=Torso:findFirstChild'Right Hip'}
  663. if _G.Limbz then
  664. Limbs.LS=Limbs.LS or _G.Limbz.LS
  665. Limbs.RS=Limbs.RS or _G.Limbz.RS
  666. Limbs.LH=Limbs.LH or _G.Limbz.LH
  667. Limbs.RH=Limbs.RH or _G.Limbz.RH
  668. end
  669. _G.Limbz=Limbs
  670. Torso.Neck.C0=cn(0,1.5,0) Torso.Neck.C1=cn(0,0,0)
  671. c2(Torso.Neck,1,3,0,1.5,0,0,0,0)
  672. LS,RS,LH,RH=Limbs.LS,Limbs.RS,Limbs.LH,Limbs.RH
  673. LA,RA,LL,RL=Char['Left Arm'],Char['Right Arm'],Char['Left Leg'],Char['Right Leg']
  674. LS.Part0,RS.Part0,LH.Part0,RH.Part0=Torso,Torso,Torso,Torso
  675. LS.Part1,RS.Part1,LH.Part1,RH.Part1=LA,RA,LL,RL
  676. pcall(function() thesuit:Remove() end)
  677. Head.face.Transparency=0
  678. Head.Transparency=1 Torso.Transparency=1
  679. fTorso=pa(Suit,"FTorso","Block",2,2,1,false,false,0,0,Torso.BrickColor.Name) neck=Torso.Neck
  680. tw=weld(fTorso,Torso,fTorso,0,0,0,0,0,0) qi{"BlockMesh",fTorso}
  681. fHead=pa(Suit,"FHead","Block",2,1,1,false,false,0,0,Head.BrickColor.Name)
  682. hw=weld(fHead,fTorso,fHead,0,1.5,0,0,0,0) qi{"SpecialMesh",fHead,Scale=v3(1.15,1.15,1.15)} Head.face:Clone().Parent=fHead Head.face.Transparency=1
  683. la=qi{'Weld',fTorso,Part0=fTorso,C0=cn(-1.5,0.5,0),C1=cn(0,0.5,0)} ra=qi{'Weld',fTorso,Part0=fTorso,C0=cn(1.5,0.5,0),C1=cn(0,0.5,0)}
  684. ll=qi{'Weld',fTorso,Part0=fTorso,C0=cn(-0.5,-1,0),C1=cn(0,1,0)} rl=qi{'Weld',fTorso,Part0=fTorso,C0=cn(0.5,-1,0),C1=cn(0,1,0)}
  685. newhats(Char,fHead,Head) ClearClass(Char,"Hat") Hum.WalkSpeed=16 Hum.MaxHealth=175
  686. Armz=false
  687. Legz=false
  688. Arms = function(on) Armz=on
  689. if on then
  690. LS.Part1=nil RS.Part1=nil
  691. la.Part0=fTorso ra.Part0=fTorso
  692. la.Part1=LA ra.Part1=RA
  693. la.C0,la.C1=cn(-1.5,0.5,0),cn(0,0.5,0)
  694. ra.C0,ra.C1=cn(1.5,0.5,0),cn(0,0.5,0)
  695. else
  696. LS.Parent,RS.Parent=fTorso,fTorso LS.Part0=fTorso RS.Part0=fTorso LS.Part1=LA RS.Part1=RA
  697. la.Part1=nil ra.Part1=nil
  698. end
  699. end
  700. Legs = function(on) Legz=on
  701. if on then
  702. LH.Part1=nil RH.Part1=nil
  703. ll.Part0=fTorso rl.Part0=fTorso
  704. ll.Part1=LL rl.Part1=RL
  705. ll.C0,ll.C1=cn(-0.5,-1,0),cn(0,1,0)
  706. rl.C0,rl.C1=cn(0.5,-1,0),cn(0,1,0)
  707. else
  708. LH.Parent,RH.Parent=fTorso,fTorso LH.Part0=fTorso RH.Part0=fTorso LH.Part1=LL RH.Part1=RL
  709. ll.Part1=nil rl.Part1=nil
  710. end
  711. end
  712. Arms'' Legs''
  713. WDesign=function(c)
  714. ha=pa(Weapon,"","Block",0.2,0.5,1,false,false,0,0,c[1]) haw=weld(ha,Torso,ha,0.5,2.5,1,rd(270),0,rd(90))
  715. gp=pa(Weapon,"","Block",0.2,1,0.2,false,false,0,0,c[1]) weld(gp,ha,gp,0,-0.35,0,rd(-90),0,0) qi{'SpecialMesh',gp,MeshType='Wedge'}
  716. gp=pa(Weapon,"","Block",0.2,0.7,0.2,false,false,0,0,c[2]) weld(gp,ha,gp,0,-0.1,0.55,0,0,0) qi{'BlockMesh',gp,Scale=v3(1,1,0.5)}
  717. gp=pa(Weapon,"","Block",0.2,0.5,0.5,false,false,0,0,c[1]) weld(gp,ha,gp,0,-0.115,-0.5,rd(45),0,0)
  718. gp=pa(Weapon,"","Block",0.2,0.5,1,false,false,0,0,c[1]) weld(gp,ha,gp,0,-0.1,-0.95,rd(15),0,0)
  719. gpp=pa(Weapon,"","Block",0.21,0.6,0.3,false,false,0,0,c[3]) weld(gpp,ha,gpp,0,0,-1.5,0,0,0)
  720. gp=pa(Weapon,"","Block",0.2,0.2,0.2,false,false,0,0,c[3]) weld(gp,gpp,gp,0,-0.4,0.05,0,rd(90),0) qi{'SpecialMesh',gp,MeshId=ids.Ring,Scale=v3(0.35,0.35,1)}
  721. gp=pa(Weapon,"","Block",0.2,0.2,0.2,false,false,0,0,c[3]) weld(gp,gpp,gp,0,-0.4,0.05,rd(10),rd(90),0) qi{'BlockMesh',gp,Scale=v3(0.25,1,0.25)}
  722. gp1=pa(Weapon,"","Block",1.2,0.2,1.2,false,false,0,0,c[3]) weld(gp1,gpp,gp1,0,-0.25,-0.2,rd(90),0,0) qi{'CylinderMesh',gp1}
  723. p1=pa(Weapon,"","Block",0.4,1.3,0.2,false,false,0,0,c[3]) weld(p1,gp1,p1,0,0,0.1,rd(90),0,0)
  724. p2=pa(Weapon,"","Block",0.2,0.4,0.2,false,false,0,0,c[3]) weld(p2,p1,p2,0,1.3/2,0,0,0,rd(90)) qi{'CylinderMesh',p2}
  725. hinge=pa(Weapon,"","Block",0.2,0.4,0.2,false,false,0,0,c[4]) hingew=weld(hinge,p2,hinge,0,0,0,0,rd(0),0) qi{'CylinderMesh',hinge,Scale=v3(0.6,1.001,0.6)}
  726. p3=pa(Weapon,"","Block",0.4,0.3,0.2,false,false,0,0,c[3]) weld(p3,p1,p3,0,-1.3/2,0,0,0,0) qi{'BlockMesh',p3}
  727. p4=pa(Weapon,"","Block",0.2,0.2,0.2,false,false,0,0,c[3]) weld(p4,p3,p4,0.15,-0.2,0,0,0,0) qi{'BlockMesh',p4,Scale=v3(0.5,1,1)}
  728. p5=pa(Weapon,"","Block",0.2,0.2,0.2,false,false,0,0,c[3]) weld(p5,p3,p5,-0.15,-0.2,0,0,0,0) qi{'BlockMesh',p5,Scale=v3(0.5,1,1)}
  729. p6=pa(Weapon,"","Block",0.4,0.2,0.7,false,false,0,0,c[3]) weld(p6,hinge,p6,0,0,0.35,0,0,rd(-90)) qi{'BlockMesh',p6,Scale=v3(1,0.5,1)}
  730. p7=pa(Weapon,"","Block",0.4,0.2,0.4,false,false,0,0,c[3]) weld(p7,p6,p7,0,0,0.55,rd(180),0,0) qi{'SpecialMesh',p7,Scale=v3(1,0.5,1),MeshType="Wedge"}
  731. p8=pa(Weapon,"","Block",0.4,0.2,0.4,false,false,0,0,c[3]) weld(p8,p7,p8,0,-0.15,0,rd(180),0,0) qi{'SpecialMesh',p8,MeshType="Wedge"}
  732. p9=pa(Weapon,"","Block",0.4,0.2,0.3,false,false,0,0,c[3]) weld(p9,p8,p9,0,0,0.35,0,0,0) qi{'BlockMesh',p9}
  733. p10=pa(Weapon,"","Block",0.4,0.2,0.3,false,false,0,0,c[3]) weld(p10,p9,p10,0,0,0.3,0,rd(180),0) qi{'SpecialMesh',p10,MeshType="Wedge"}
  734. p11=pa(Weapon,"","Block",0.4,0.2,0.3,false,false,0,0,c[3]) weld(p11,p10,p11,0,-0.2,0,0,0,0) qi{'BlockMesh',p11}
  735. p12=pa(Weapon,"","Block",0.3,0.2,0.3,false,false,0,0,c[3]) weld(p12,p11,p12,0.35,0,0,0,rd(-90),0) qi{'SpecialMesh',p12,MeshType="Wedge"}
  736. p13=pa(Weapon,"","Block",0.3,0.2,0.3,false,false,0,0,c[3]) weld(p13,p11,p13,-0.35,0,0,0,rd(90),0) qi{'SpecialMesh',p13,MeshType="Wedge"}
  737. p14=pa(Weapon,"","Block",1.5,0.3,1.5,false,false,0,0,c[3]) weld(p14,p11,p14,0,-0.7,0,rd(90),0,0) qi{'CylinderMesh',p14}
  738. p15=pa(Weapon,"","Block",1.3,0.2,1.3,false,false,0,0,c[2]) weld(p15,p14,p15,0,0.25,0,0,0,0) qi{'CylinderMesh',p15}
  739. p16=pa(Weapon,"","Block",0.2,1.4,0.2,false,false,0,0,c[2]) piperw=weld(p16,p15,p16,0,0.7,0,0,rd(30),0) qi{'CylinderMesh',p16}
  740. for i=0,360,360/6 do
  741. p16p=pa(Weapon,"","Block",0.5,1.1,0.5,false,false,0,0,c[2]) p16pw=weld(p16p,p16,p16p,0,0,0,0,0,0) qi{'CylinderMesh',p16p} p16pw.C0=cn(0,-0.05,0)*ca(0,rd(i),0)*cn(0.4,0,0)
  742. p16p=pa(Weapon,"","Block",0.3,0.2,0.3,false,false,0,0,c[5]) p16pw=weld(p16p,p16,p16p,0,0,0,0,0,0) qi{'CylinderMesh',p16p,Scale=v3(1,0.1,1)} p16pw.C0=cn(0,0.5,0)*ca(0,rd(i),0)*cn(0.4,0,0)
  743. p16p=pa(Weapon,"","Block",0.2,0.2,0.2,false,false,0,0,c[2]) p16pw=weld(p16p,p16,p16p,0,0,0,0,0,0) qi{'CylinderMesh',p16p,Scale=v3(1,0.1,1)} p16pw.C0=cn(0,0.51,0)*ca(0,rd(i),0)*cn(0.4,0,0)
  744. end
  745. p17=pa(Weapon,"","Block",0.2,0.2,0.3,false,false,0,0,c[3]) weld(p17,p14,p17,0,0,0.75,rd(90),rd(180),0) qi{'SpecialMesh',p17,MeshType="Wedge",Scale=v3(1,1,1)}
  746. p18=pa(Weapon,"","Block",0.2,0.2,1.5,false,false,0,0,c[3]) weld(p18,p17,p18,0,0.05,0.9,0,0,0) qi{'BlockMesh',p18,Scale=v3(1,0.5,1)}
  747. p19=pa(Weapon,"","Block",0.2,0.2,0.2,false,false,0,0,c[3]) weld(p19,p18,p19,0,0.1,0,0,0,0) qi{'SpecialMesh',p19,Scale=v3(0.5,0.5,1),MeshType="Wedge"}
  748. p20=pa(Weapon,"","Block",0.2,0.2,0.3,false,false,0,0,c[3]) weld(p20,p19,p20,0,0,0.25,0,0,0) qi{'BlockMesh',p20,Scale=v3(0.5,0.5,1)}
  749. p21=pa(Weapon,"","Block",0.2,0.2,0.2,false,false,0,0,c[3]) weld(p21,p20,p21,0,0,0.175,0,rd(180),0) qi{'SpecialMesh',p21,Scale=v3(0.5,0.5,0.25),MeshType="Wedge"}
  750. p22=pa(Weapon,"","Block",0.2,0.2,0.2,false,false,0,0,c[4]) weld(p22,p20,p22,0,0,0.05,0,0,rd(90)) qi{'CylinderMesh',p22,Scale=v3(0.25,0.51,0.25)}
  751. p23=pa(Weapon,"","Block",0.75,0.8,0.75,false,false,0,0,c[2]) weld(p23,p14,p23,0,0.1,0.3,0,0,0) qi{'SpecialMesh',p23} -- start of barrel
  752. p24=pa(Weapon,"","Block",0.6,1.8,0.6,false,false,0,0,c[2]) weld(p24,p23,p24,0,-0.9,0,0,0,0) qi{'CylinderMesh',p24}
  753. p25=pa(Weapon,"","Block",0.4,0.2,0.4,false,false,0,0,c[6]) weld(p25,p24,p25,0,-0.9,0,0,0,0) qi{'CylinderMesh',p25,Scale=v3(1,0.1,1)}
  754. p26=pa(Weapon,"","Block",0.65,0.2,0.65,false,false,0,0,c[3]) weld(p26,p24,p26,0,-0.4,0,0,0,0) qi{'CylinderMesh',p26,Scale=v3(1,1,1)}
  755. p26=pa(Weapon,"","Block",0.6,0.4,0.8,false,false,0,0,c[1]) weld(p26,p24,p26,0,0.17,-0.4,rd(90),0,0)
  756. p27=pa(Weapon,"","Block",0.6,0.4,0.4,false,false,0,0,c[1]) weld(p27,p26,p27,0,0,0.6,rd(180),0,0) qi{'SpecialMesh',p27,MeshType="Wedge"}
  757. for i,v in pairs(Weapon:GetChildren()) do v.CanCollide=false end
  758. end
  759. WDesign({"Reddish brown","Really black","Dark stone grey","White","Medium stone grey","Really black"}) Arms(false) Legs(false)
  760. BBD,BBT=0,{}
  761. Dealt={20,40}
  762. function Destroy(Directory,Part,Distance)
  763. for i,v in pairs(Directory:GetChildren()) do
  764. if v:IsA("BasePart") and not GetHum(v) and v.Parent.Name~=Tn and v.Parent.Name~=Suit.Name and v.Name~="Ignore" and v.Name~="Base" then
  765. if (Part.Position-v.Position).magnitude<=Distance and v:GetMass()<=1000 then
  766. v.Anchored=false
  767. v:BreakJoints()
  768. v.CFrame=cn(v.Position,Part.Position)*ca(0,rd(180),0)
  769. v.Velocity=cn(Part.Position,v.Position).lookVector*50
  770. end
  771. elseif v:IsA("Model") or v:IsA("Script") or v:IsA("BasePart") and v.Name=="Base" then
  772. Destroy(v,Part,Distance)
  773. end
  774. end
  775. end
  776. SplashDmg=function(Part,Distance)
  777. q(function()
  778. qi{"Explosion",workspace,Position=Part.Position,BlastPressure=0}
  779. for i,v in pairs(workspace:GetChildren()) do
  780. if v:FindFirstChild("Torso",true) then
  781. local vTorso=v:FindFirstChild("Torso",true)
  782. if (vTorso.Position-Part.Position).magnitude<=Distance then
  783. local vHum=GetHum(vTorso)
  784. if not vHum or BBD==0 or BBT[vHum.Parent] then return end
  785. BBT[vHum.Parent]=1
  786. if rn(1,20)==1 then
  787. Dmg(vHum,rn(Dealt[1],Dealt[2])*3,true)
  788. else
  789. Dmg(vHum,rn(Dealt[1],Dealt[2]),false)
  790. end
  791. if BBD==2 and vTorso then
  792. vHum.PlatformStand=true
  793. if vHum.Jump then
  794. AddBV(120,cn(Part.Position,vTorso.Position),vTorso,0.4)
  795. else
  796. AddBV(100,cn(Part.Position,vTorso.Position),vTorso,0.4)
  797. end
  798. if vTorso.Parent~=Char then
  799. AddBAV(v3(rn(-50,50),rn(-50,50),rn(-50,50)),vTorso,0.4)
  800. end
  801. q(function()
  802. wait(0.6)
  803. vHum.PlatformStand=false
  804. end)
  805. end
  806. so(ids.Hit,vTorso,1,1)
  807. BBT[vHum.Parent]=nil
  808. end
  809. end
  810. end
  811. end)
  812. end
  813. Fire = function(speed,sc,cff,dest)
  814. q(function()
  815. local bb = pa(workspace,"bullet","Block",0.4*sc,0.6*sc,0.4*sc,false,true,0,0,"Bright red") bb.CanCollide=false qi{"CylinderMesh",bb}
  816. local pp0 = pa(bb,"bullet","Block",0.2*sc,0.2*sc,0.2*sc,false,true,0,0,"Bright red") pp0.CanCollide=false qi{"SpecialMesh",pp0,MeshType="Sphere",Scale=v3(2,2,2)}
  817. local pp1 = pa(bb,"bullet","Block",0.2*sc,0.2*sc,0.2*sc,false,true,0,0,"Really black") pp1.CanCollide=false qi{"CylinderMesh",pp1,Scale=v3(2.02,0.25,2.02)}
  818. local pp2 = pa(bb,"bullet","Block",0.2*sc,0.2*sc,0.2*sc,false,true,0,0,"Really black") pp2.CanCollide=false qi{"CylinderMesh",pp2,Scale=v3(2.02,2,2.02)}
  819. bb.CFrame = cn(cff.p,dest)*ca(rd(-90),0,0)
  820. local m=pa(Weapon,"muzzle","Block",1,1,1,false,false,0,0,"Bright orange") qi{"SpecialMesh",m,MeshId=ids.Crown,Scale=v3(0.5,0.5,0.5)} weld(m,p25,m,0,-0.6,0.05,rd(180),0,0) fade(m,0.2)
  821. local m=pa(Weapon,"muzzle","Block",1,1,1,false,false,0,0,"Bright orange") qi{"SpecialMesh",m,MeshId=ids.Crown2,Scale=v3(0.4,0.7,0.4)} weld(m,p25,m,0,-0.8,0,rd(180),0,0) fade(m,0.2)
  822. for i=1,100 do
  823. bhit,bpos=ray(bb.Position,bb.Position - (bb.CFrame *cn(0,-2,0)).p)
  824. bhit2,bpos2=ray(pp0.Position,pp0.Position - (pp0.CFrame *cn(0,-2,0)).p)
  825. bhit3,bpos3=ray(pp1.Position,bb.Position - (pp1.CFrame *cn(0,-2,0)).p)
  826. bhit4,bpos4=ray(pp2.Position,pp0.Position - (pp2.CFrame *cn(0,-2,0)).p)
  827. if bhit and bhit.Name ~= "bullet" and bhit.Name ~= "bullethole" and bhit.Name~="muzzle" and bpos and (bpos - bb.Position).magnitude < speed then break end
  828. if bhit2 and bhit2.Name ~= "bullet" and bhit2.Name ~= "bullethole" and bhit2.Name~="muzzle" and bpos2 and (bpos2 - bb.Position).magnitude < speed then break end
  829. if bhit3 and bhit3.Name ~= "bullet" and bhit3.Name ~= "bullethole" and bhit3.Name~="muzzle" and bpos3 and (bpos3 - bb.Position).magnitude < speed then break end
  830. if bhit4 and bhit4.Name ~= "bullet" and bhit4.Name ~= "bullethole" and bhit4.Name~="muzzle" and bpos4 and (bpos4 - bb.Position).magnitude < speed then break end
  831. bb.CFrame=bb.CFrame*cn(0,speed,0)*ca(rd(-0.3),0,0)
  832. pp0.CFrame=bb.CFrame*cn(0,0.3,0)
  833. pp1.CFrame=bb.CFrame*cn(0,-0.3,0)
  834. pp2.CFrame=bb.CFrame*cn(0,0.1,0)
  835. wait()
  836. end
  837. GlowMesh(false,"sphere",Weapon,v3(3,3,3),"Bright red",cn(bpos),0.25,1,0.05)
  838. BBD=2
  839. sopart=pa(workspace,"bullet","Block",0,0,0,true,true,1,0)
  840. bb.CFrame=bb.CFrame*cn(0,(bpos-bb.Position).magnitude,0)
  841. pp0.CFrame=bb.CFrame*cn(0,0.3,0)
  842. pp1.CFrame=bb.CFrame*cn(0,-0.3,0)
  843. pp2.CFrame=bb.CFrame*cn(0,0.1,0)
  844. sopart.CFrame=bb.CFrame
  845. so(ids.Explode,sopart,1,0.4)
  846. SplashDmg(bb,11)
  847. Destroy(workspace,bb,13)
  848. BBD=0
  849. deb:AddItem(bb,1)
  850. deb:AddItem(sopart,1)
  851. end)
  852. end
  853. function Stance(speed)
  854. c2(ra,speed,3,1.25,0.5,-0.25,-75,-65,0)
  855. c2(la,speed,3,-1.25,0.5,-0.25,-70,-20,0)
  856. c2(ll,speed,3,-0.5,-1,0,0,0,0)
  857. c2(rl,speed,3,0.5,-1,0,0,0,0)
  858. c2(hw,speed,3,0,1.5,0,0,-65,0)
  859. c2(tw,speed,3,0,0,0,0,65,0)
  860. c2(neck,speed,3,0,1.5,0,0,0,0)
  861. c2(hingew,speed,3,0,0,0,0,0,0)
  862. c2(piperw,speed,3,0,0.7,0,0,30+PipeRotate,0)
  863. Ani(haw,0,0.5,0,-75,0,0,0,speed/2,1)
  864. end
  865. function Reset(speed)
  866. c2(ra,speed,3,1.5,0.5,0,0,0,0)
  867. c2(la,speed,3,-1.5,0.5,0,0,0,0)
  868. c2(ll,speed,3,-0.5,-1,0,0,0,0)
  869. c2(rl,speed,3,0.5,-1,0,0,0,0)
  870. c2(hw,speed,3,0,1.5,0,0,0,0)
  871. c2(tw,speed,3,0,0,0,0,0,0)
  872. c2(neck,speed,3,0,1.5,0,0,0,0)
  873. c2(piperw,speed,3,0,0.7,0,0,30+PipeRotate,0)
  874. c2(hingew,speed,3,0,0,0,0,0,0)
  875. Ani(haw,0.5,2.5,1,270,0,90,0,speed,1)
  876. end
  877. function Button1Down()
  878. if Clip>0 and anim=="" and (tick()-LastShot)>=0.6 then
  879. LastShot=tick()
  880. so(ids.Shoot,ha,1,1)
  881. Fire(3,1,p25.CFrame*cn(0,-1,0),fmouse.Hit.p)
  882. Clip=Clip-1
  883. PipeRotate=PipeRotate+60
  884. c2(piperw,0.4,3,0,0.7,0,0,30+PipeRotate,0)
  885. elseif Clip==0 and anim=="" and (tick()-LastShot)>=0.6 then
  886. anim="Reloading"
  887. c2(ra,0.1,3,1.25,0.5,-0.25,-75,-65,0)
  888. c2(la,0.1,3,-1.25,0.5,-0.25,-70,-20,0)
  889. c2(hw,0.1,3,0,1.5,0,0,-65,0)
  890. c1(hingew,0.15,3,0,0,0,0,-90,0)
  891. for i=1,6 do
  892. PipeRotate=PipeRotate+60
  893. c1(la,0.13,3,-1.25,0.25,0.1,15,0,-15)
  894. local pipe=pa(Weapon,"","Block",0.4,0.7,0.4,false,false,0,0,"Bright red") weld(pipe,LA,pipe,0,-1.1,0,rd(-90),0,0) qi{"CylinderMesh",pipe}
  895. local pp=pa(pipe,"","Block",0.4,0.4,0.4,false,false,0,0,"Bright red") weld(pp,pipe,pp,0,-0.35,0,0,0,0) qi{"SpecialMesh",pp,MeshType="Sphere"}
  896. local pp=pa(pipe,"","Block",0.41,0.2,0.41,false,false,0,0,"Really black") weld(pp,pipe,pp,0,0.35,0,0,0,0) qi{"CylinderMesh",pp,Scale=v3(1,0.25,1)}
  897. local pp=pa(pipe,"","Block",0.41,0.5,0.41,false,false,0,0,"Really black") weld(pp,pipe,pp,0,0,0,0,0,0) qi{"CylinderMesh",pp}
  898. c1(la,0.16,3,-1.25,0.4,-0.1,-100,0,-15)
  899. c1(la,0.2,3,-1.25,0.3,-0.25,-40,0,-15)
  900. so(ids.Reload,ha,1,1)
  901. c1(piperw,0.4,3,0,0.7,0,0,30+PipeRotate,0)
  902. Clip=i
  903. deb:AddItem(pipe,0.05)
  904. end
  905. Stance(0.15)
  906. anim=""
  907. end
  908. end
  909. function KeyDown(key)
  910. key=key:lower()
  911. keys[key]=true
  912. if key=="r" and anim=="" and equip=="equipped" and Clip==0 then
  913. anim="Reloading"
  914. c2(ra,0.1,3,1.25,0.5,-0.25,-75,-65,0)
  915. c2(la,0.1,3,-1.25,0.5,-0.25,-70,-20,0)
  916. c2(hw,0.1,3,0,1.5,0,0,-65,0)
  917. c1(hingew,0.15,3,0,0,0,0,-90,0)
  918. for i=1,6 do
  919. PipeRotate=PipeRotate+60
  920. c1(la,0.13,3,-1.25,0.25,0.1,15,0,-15)
  921. local pipe=pa(Weapon,"","Block",0.4,0.7,0.4,false,false,0,0,"Bright red") weld(pipe,LA,pipe,0,-1.1,0,rd(-90),0,0) qi{"CylinderMesh",pipe}
  922. local pp=pa(pipe,"","Block",0.4,0.4,0.4,false,false,0,0,"Bright red") weld(pp,pipe,pp,0,-0.35,0,0,0,0) qi{"SpecialMesh",pp,MeshType="Sphere"}
  923. local pp=pa(pipe,"","Block",0.41,0.2,0.41,false,false,0,0,"Really black") weld(pp,pipe,pp,0,0.35,0,0,0,0) qi{"CylinderMesh",pp,Scale=v3(1,0.25,1)}
  924. local pp=pa(pipe,"","Block",0.41,0.5,0.41,false,false,0,0,"Really black") weld(pp,pipe,pp,0,0,0,0,0,0) qi{"CylinderMesh",pp}
  925. c1(la,0.16,3,-1.25,0.4,-0.1,-100,0,-15)
  926. c1(la,0.2,3,-1.25,0.3,-0.25,-40,0,-15)
  927. so(ids.Reload,ha,1,1)
  928. c1(piperw,0.4,3,0,0.7,0,0,30+PipeRotate,0)
  929. Clip=i
  930. deb:AddItem(pipe,0.05)
  931. end
  932. Stance(0.15)
  933. anim=""
  934. end
  935. end
  936. Tool.Selected:connect(function(mouse)
  937. fmouse=mouse
  938. if equip=="unequipped" and anim=="" then
  939. equip="equipping" Arms(true) c2(la,0.1,3,-1.5,0.5,0,0,0,20) c1(ra,0.1,3,1.5,0.5,0,120,0,-70)
  940. local ofs = RA.CFrame:toObjectSpace(ha.CFrame)
  941. haw.Part0=RA haw.C0=ofs haw.C1=cn(0,0,0) rAni(haw)
  942. Stance(0.2) equip="equipped"
  943. end
  944. mouse.Button1Down:connect(Button1Down)
  945. mouse.KeyDown:connect(KeyDown)
  946. end)
  947. Tool.Deselected:connect(function()
  948. fmouse=nil
  949. if equip=="equipped" and anim=="" then
  950. equip="unequipping" c2(la,0.1,3,-1.5,0.5,0,0,0,0) c1(ra,0.1,3,1.5,0.5,0,120,0,-70)
  951. local ofs = Torso.CFrame:toObjectSpace(ha.CFrame)
  952. haw.Part0=Torso haw.C0=ofs haw.C1=cn(0,0,0) rAni(haw)
  953. Reset(0.1)
  954. Arms(false) Legs(false) equip="unequipped"
  955. end
  956. end)
  957. Gyro=qi{"BodyGyro",Torso,D=50,P=1500}
  958. game:GetService("RunService").Stepped:connect(function()
  959. if fmouse~=nil then
  960. Gyro.maxTorque=v3(1/0,1/0,1/0)
  961. Gyro.cframe = cn(Torso.Position,v3(fmouse.hit.p.x,Torso.Position.y,fmouse.hit.p.z))
  962. else
  963. Gyro.maxTorque = v3(0,0,0)
  964. end
  965. if equip=="equipped" and anim=="" and fmouse~=nil then
  966. c2(ra,1,3,1.25,0.5,-0.25,-75+math.deg((Torso.Position-fmouse.Hit.p).unit.y),-65,0)
  967. c2(la,1,3,-1.25,0.5,-0.25,-70+math.deg((Torso.Position-fmouse.Hit.p).unit.y),-20,0)
  968. c2(hw,1,3,0,1.5,0,math.deg((Torso.Position-fmouse.Hit.p).unit.y),-65,0)
  969. end
  970. end)
Add Comment
Please, Sign In to add comment