Advertisement
Kaemi

DEMOMAN

Dec 29th, 2016
622
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.98 KB | None | 0 0
  1. it = Instance.new
  2.  
  3.  
  4. v3=Vector3.new
  5.  
  6.  
  7. bc=BrickColor.new
  8.  
  9.  
  10. c3=Color3.new
  11.  
  12.  
  13. cn=CFrame.new
  14.  
  15.  
  16. ca=CFrame.Angles
  17.  
  18.  
  19. ca2=function(a,b,c)
  20.  
  21.  
  22. return ca(math.rad(a),math.rad(b),math.rad(c))
  23.  
  24.  
  25. end
  26.  
  27.  
  28. ti=table.insert
  29.  
  30.  
  31. tr=table.remove
  32.  
  33.  
  34. rn=math.random
  35.  
  36.  
  37. rd=math.rad
  38.  
  39.  
  40. mf=math.floor
  41.  
  42.  
  43. ud = UDim2.new
  44.  
  45.  
  46. inf=math.huge
  47.  
  48.  
  49. dg=math.deg
  50.  
  51.  
  52. mdeg=math.deg
  53.  
  54.  
  55. v310=v3(1/0,1/0,1/0)
  56.  
  57.  
  58. pi=math.pi
  59.  
  60.  
  61. w=wait
  62.  
  63.  
  64. cf=cn
  65.  
  66.  
  67. bn=bc
  68.  
  69.  
  70. ts=tostring
  71.  
  72.  
  73.  
  74.  
  75. Workspace=game:GetService("Workspace")
  76.  
  77.  
  78. Players=game:GetService("Players")
  79.  
  80.  
  81. Player=Players.LocalPlayer
  82.  
  83.  
  84. Lighting=game:GetService("Lighting")
  85.  
  86.  
  87. Debris=game:GetService("Debris")
  88.  
  89.  
  90.  
  91.  
  92. work=Workspace
  93.  
  94.  
  95. server=Players
  96.  
  97.  
  98. tb=Player
  99.  
  100.  
  101. lighting=Lighting
  102.  
  103.  
  104. deb=Debris
  105.  
  106.  
  107.  
  108.  
  109. asset = "http://www.roblox.com/asset/?id="
  110.  
  111.  
  112. Asset=asset
  113.  
  114.  
  115.  
  116.  
  117. ids = {}
  118.  
  119.  
  120. ids.Shoot = 10209633
  121.  
  122.  
  123. ids.Reload = 10209636
  124.  
  125.  
  126. ids.Crown = 20329976
  127.  
  128.  
  129. ids.Crown2 = 1323306
  130.  
  131.  
  132. ids.Icon = 52611635
  133.  
  134.  
  135. ids.Explode = 2697431
  136.  
  137.  
  138. ids.Ring = 3270017
  139.  
  140.  
  141.  
  142.  
  143. for i,v in pairs(ids) do
  144.  
  145.  
  146. if type(v)=='number' then
  147.  
  148.  
  149. ids[i]='http://www.roblox.com/asset/?id='..v
  150.  
  151.  
  152. end
  153.  
  154.  
  155. game:GetService("ContentProvider"):Preload(ids[i])
  156.  
  157.  
  158. end
  159.  
  160.  
  161.  
  162.  
  163. qi = function(ttz)
  164.  
  165.  
  166. local qii = it(ttz[1]) table.foreach(ttz,function(oi,oi2)
  167.  
  168.  
  169. if oi ~= 1 and oi ~= 2 then qii[oi] = oi2 end end) qii.Parent=ttz[2] return qii end
  170.  
  171.  
  172.  
  173.  
  174. q = function(f)
  175.  
  176.  
  177. coroutine.resume(coroutine.create(function() f() end)) end
  178.  
  179.  
  180.  
  181.  
  182.  
  183. ft = function(tablez,item)
  184.  
  185.  
  186. for i=1,#tablez do if tablez[i] == item then return i end end return nil end
  187.  
  188.  
  189.  
  190.  
  191. ft2 = function(tablez,item)
  192.  
  193.  
  194. for i=1,#tablez do if tablez[i][1] == item then return i end end return nil end
  195.  
  196.  
  197.  
  198.  
  199. pa = function(pa,pn,sh,x,y,z,c,a,tr,re,bc2)
  200.  
  201.  
  202. local fp=nil
  203.  
  204.  
  205. if sh ~= "Wedge" and sh ~= "CornerWedge" and sh ~= "VehicleSeat" and sh ~= "Seat" then
  206.  
  207.  
  208. fp=it("Part",pa)
  209.  
  210.  
  211. fp.Shape=sh or "Block"
  212.  
  213.  
  214. fp.formFactor="Custom"
  215.  
  216.  
  217. elseif sh == "Wedge" then
  218.  
  219.  
  220. fp=it("WedgePart",pa)
  221.  
  222.  
  223. fp.formFactor="Custom"
  224.  
  225.  
  226. elseif sh == "CornerWedge" then
  227.  
  228.  
  229. fp=it("CornerWedgePart",pa)
  230.  
  231.  
  232. elseif sh == "VehicleSeat" then
  233.  
  234.  
  235. fp=it("VehicleSeat",pa)
  236.  
  237.  
  238. elseif sh == "Seat" then
  239.  
  240.  
  241. fp=it("Seat",pa)
  242.  
  243.  
  244. end
  245.  
  246.  
  247. fp.Size=v3(x or 4,y or 2,z or 2)
  248.  
  249.  
  250. fp.Friction = 2
  251.  
  252.  
  253. fp.CanCollide=c or true
  254.  
  255.  
  256. fp.Anchored=a or false
  257.  
  258.  
  259. fp.BrickColor=bc(bc2 or "")
  260.  
  261.  
  262. fp.Transparency=tr or 0
  263.  
  264.  
  265. fp.Reflectance=re or 0
  266.  
  267.  
  268. fp.BottomSurface=0
  269.  
  270.  
  271. fp.Name=pn or "TBLib Part"
  272.  
  273.  
  274. fp.Locked = true
  275.  
  276.  
  277. fp.TopSurface=0
  278.  
  279.  
  280. fp.CFrame=cn(0,0,0)
  281.  
  282.  
  283. fp:BreakJoints()
  284.  
  285.  
  286. fp.Anchored = a
  287.  
  288.  
  289. return fp
  290.  
  291.  
  292. end
  293.  
  294.  
  295.  
  296.  
  297. function ClearClass(Object,Class)
  298.  
  299.  
  300. for _,v in pairs(Object:GetChildren()) do
  301.  
  302.  
  303. if v:IsA(Class) then
  304.  
  305.  
  306. v:Destroy()
  307.  
  308.  
  309. end
  310.  
  311.  
  312. end
  313.  
  314.  
  315. end
  316.  
  317.  
  318.  
  319.  
  320. function GetClass(Object,Class)
  321.  
  322.  
  323. for _,v in pairs(Object:GetChildren()) do
  324.  
  325.  
  326. if v:IsA(Class) then
  327.  
  328.  
  329. return v
  330.  
  331.  
  332. end
  333.  
  334.  
  335. end
  336.  
  337.  
  338. end
  339.  
  340.  
  341.  
  342.  
  343. function re(par,obj)
  344.  
  345.  
  346. if par:findFirstChild(obj) then
  347.  
  348.  
  349. par[obj]:Remove''
  350.  
  351.  
  352. end
  353.  
  354.  
  355. end
  356.  
  357.  
  358.  
  359.  
  360. function invis(o)
  361.  
  362.  
  363. for i,v in pairs(o:children()) do
  364.  
  365.  
  366. if v:IsA("BasePart") then
  367.  
  368.  
  369. v.Transparency=1
  370.  
  371.  
  372. end
  373.  
  374.  
  375. invis(v)
  376.  
  377.  
  378. end
  379.  
  380.  
  381. end
  382.  
  383.  
  384.  
  385.  
  386. function newhats(p,o,o2)
  387.  
  388.  
  389. for i,v in pairs(p:children()) do
  390.  
  391.  
  392. if v:IsA("Hat") then
  393.  
  394.  
  395. local np=v.Handle:Clone''
  396.  
  397.  
  398. np.Transparency=0
  399.  
  400.  
  401. np.Mesh.Scale=np.Mesh.Scale*1.04
  402.  
  403.  
  404. np.Parent=o
  405.  
  406.  
  407. np.CFrame=v.Handle.CFrame
  408.  
  409.  
  410. np.Name="Hat"
  411.  
  412.  
  413. stick2(np,o2,o)
  414.  
  415.  
  416. end
  417.  
  418.  
  419. end
  420.  
  421.  
  422. end
  423.  
  424.  
  425.  
  426.  
  427. fade = function(prt,incr)
  428.  
  429.  
  430. q(function()
  431.  
  432.  
  433. for i=prt.Transparency,1,incr do
  434.  
  435.  
  436. prt.Transparency=i
  437.  
  438.  
  439. wait()
  440.  
  441.  
  442. end
  443.  
  444.  
  445. prt:Remove''
  446.  
  447.  
  448. end)
  449.  
  450.  
  451. end
  452.  
  453.  
  454.  
  455.  
  456.  
  457. function weld(pa,p0,p1,x,y,z,a,b,c)
  458.  
  459.  
  460. local fw=it("Weld",pa)
  461.  
  462.  
  463. fw.Part0=p0
  464.  
  465.  
  466. fw.Part1=p1
  467.  
  468.  
  469. fw.C0=cn(x,y,z)*ca(a,b,c)
  470.  
  471.  
  472. return fw
  473.  
  474.  
  475. end
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482. stick = function(hit2,hit)
  483.  
  484.  
  485. return qi({"Weld",hit2,Part0=hit2,Part1=hit,C0=hit2.CFrame:inverse()*cn(hit2.Position),C1=hit.CFrame:inverse()*cn(hit2.Position)})
  486.  
  487.  
  488. end
  489.  
  490.  
  491.  
  492.  
  493. function stick2(hit2,hit,tostick)
  494.  
  495.  
  496. local weld=it("Weld")
  497.  
  498.  
  499. weld.Part0=tostick
  500.  
  501.  
  502. weld.Part1=hit2
  503.  
  504.  
  505. local HitPos=hit.Position
  506.  
  507.  
  508. local CJ=cn(HitPos)
  509.  
  510.  
  511. local C0=hit2.CFrame:inverse() *CJ
  512.  
  513.  
  514. local C1=hit.CFrame:inverse() * CJ weld.C0=C1
  515.  
  516.  
  517. weld.C1=C0
  518.  
  519.  
  520. weld.Parent=hit2
  521.  
  522.  
  523. end
  524.  
  525.  
  526.  
  527.  
  528. ray = function(Pos, Dir,tab)
  529.  
  530.  
  531. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit *999),tab)
  532.  
  533.  
  534. end
  535.  
  536.  
  537.  
  538.  
  539.  
  540. function rtab(tabz,obj)
  541.  
  542.  
  543. for i=1,#tabz do
  544.  
  545.  
  546. if tabz[i] == obj then
  547.  
  548.  
  549. tr(tabz,i)
  550.  
  551.  
  552. break
  553.  
  554.  
  555. end
  556.  
  557.  
  558. end
  559.  
  560.  
  561. end
  562.  
  563.  
  564.  
  565.  
  566. sTrail={}
  567.  
  568.  
  569. function Trail2(lopz,ob,waitz,col,thickz,ofz) cw(function() ti(sTrail,ob)
  570.  
  571.  
  572. local oldpos=(ob.CFrame *ofz).p local lopz2=0
  573.  
  574.  
  575. local function loltr() local obp=(ob.CFrame *ofz).p lopz2=lopz2 + 1
  576.  
  577.  
  578. local mag=(oldpos - obp).magnitude
  579.  
  580.  
  581. local tr=pa(ob,"trail","Block",0,0,0,false,false,0.5,0.15,col) tr.Anchored=true
  582.  
  583.  
  584. tr.CFrame=cn(oldpos,obp)
  585.  
  586.  
  587. tr.CFrame=tr.CFrame + tr.CFrame.lookVector* (mag/2)
  588.  
  589.  
  590. local trm=it("CylinderMesh",tr) trm.Scale=v3(5*thickz,mag*5,5*thickz)
  591.  
  592.  
  593. cw(function() for i=5*thickz,0,-5*thickz/10 do trm.Scale=v3(i,mag*5,i) w() end tr:Remove'' end)
  594.  
  595.  
  596. tr.CFrame=tr.CFrame *ca(rd(90),0,0) oldpos=obp end
  597.  
  598.  
  599. repeat loltr()
  600.  
  601.  
  602. wait(waitz) until ft(sTrail,ob) == nil or lopz2 == lopz loltr() end) end
  603.  
  604.  
  605.  
  606.  
  607. Trail = function(ob,times,waitz,col,thickz,ofz) -- Brick Trail
  608.  
  609.  
  610. q(function()
  611.  
  612.  
  613. local oldpos=(ob.CFrame *ofz).p
  614.  
  615.  
  616. for i=1,times do
  617.  
  618.  
  619. if effon==true then
  620.  
  621.  
  622. local obp=(ob.CFrame *ofz).p
  623.  
  624.  
  625. local mag=(oldpos - obp).magnitude
  626.  
  627.  
  628. local tr=pa(ob,"trail","Block",0,0,0,false,false,0.5,0.15,col)
  629.  
  630.  
  631. tr.Anchored=true
  632.  
  633.  
  634. tr.CFrame=cn(oldpos,obp)
  635.  
  636.  
  637. tr.CFrame=tr.CFrame + tr.CFrame.lookVector* (mag/2)
  638.  
  639.  
  640. trm=it("CylinderMesh",tr)
  641.  
  642.  
  643. trm.Scale=v3(thickz,mag*5,thickz)
  644.  
  645.  
  646. q(function()
  647.  
  648.  
  649. for i=thickz,0,thickz/10 do
  650.  
  651.  
  652. trm.Scale=v3(i,mag*5,i)
  653.  
  654.  
  655. wait()
  656.  
  657.  
  658. end
  659.  
  660.  
  661. tr:Remove''
  662.  
  663.  
  664. end)
  665.  
  666.  
  667. tr.CFrame=tr.CFrame *ca(rd(90),0,0)
  668.  
  669.  
  670. oldpos=obp wait(waitz)
  671.  
  672.  
  673. end
  674.  
  675.  
  676. end
  677.  
  678.  
  679. end)
  680.  
  681.  
  682. end
  683.  
  684.  
  685.  
  686.  
  687. de = function(it,ti) game:service'Debris':AddItem(it,ti) end -- Debris
  688.  
  689.  
  690.  
  691.  
  692. GlowMesh = function(anch,meshid2,rootz,mv3,colzz,adjus,l1,l2,l3) q(function() -- Glowmesh
  693.  
  694.  
  695. 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
  696.  
  697.  
  698. 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
  699.  
  700.  
  701. for i=l1,l2,l3 do spi.Transparency=i spim.Scale=mv3*(i+0.3) wait() end spi:Remove'' end)
  702.  
  703.  
  704. end
  705.  
  706.  
  707.  
  708.  
  709. DetectSurface = function(pos, part) -- Surface Detector
  710.  
  711.  
  712. local surface = nil local pospos = part.CFrame
  713.  
  714.  
  715. local pos2 = pospos:pointToObjectSpace(pos) local siz = part.Size local shaep = part.Shape
  716.  
  717.  
  718. if shaep == Enum.PartType.Ball or shaep == Enum.PartType.Cylinder then
  719.  
  720.  
  721. surface = {"Anything", cn(pospos.p, pos)*cn(0, 0, -(pospos.p - pos).magnitude+0.12)*ca(rd(-90), 0, 0)}
  722.  
  723.  
  724. else if pos2.Y > ((siz.Y/2)-0.01) then surface = {"Top", ca(0, 0, 0)}
  725.  
  726.  
  727. 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))}
  728.  
  729.  
  730. 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
  731.  
  732.  
  733.  
  734.  
  735. BulletHole = function(HitPos,HitObj,sc,img,par) -- Bullethole function
  736.  
  737.  
  738. local Surface = DetectSurface(HitPos, HitObj)
  739.  
  740.  
  741. local C = cn(HitPos) * ca(HitObj.CFrame:toEulerAnglesXYZ()) * Surface[2]
  742.  
  743.  
  744. if Surface[1] == "Anything" then C = Surface[2] end local theimg = img or ds.BulletHole
  745.  
  746.  
  747. local bl = pa(workspace or par,"bullethole","Block",sc,0,sc,false,true,1,0,"") qi({"Decal",bl,Face="Top",Texture=theimg})
  748.  
  749.  
  750. 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)
  751.  
  752.  
  753. end
  754.  
  755.  
  756.  
  757.  
  758. so = function(id,par,vol,pit) q(function() -- Sound maker
  759.  
  760.  
  761. local sou = qi({"Sound",par or workspace,Volume=vol,Pitch=pit or 1,SoundId=id})
  762.  
  763.  
  764. wait() sou:play() wait(6) sou:Remove() end) end
  765.  
  766.  
  767.  
  768.  
  769. -- local/so(asset..ds.GothicMusic,workspace,1,2.6)
  770.  
  771.  
  772.  
  773.  
  774. function GetRegion(p0,p1,f,f2) q(function()
  775.  
  776.  
  777. 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
  778.  
  779.  
  780. end) end
  781.  
  782.  
  783.  
  784.  
  785.  
  786. FindGround = function(pos) -- ground finder
  787.  
  788.  
  789. local ax,ay,az = pos:toEulerAnglesXYZ()
  790.  
  791.  
  792. local bhit,bpos=ray(pos.p,pos.p - (pos.p + v3(0,200,0)))
  793.  
  794.  
  795. if bhit and bpos then
  796.  
  797.  
  798. return cn(bpos)*ca(ax,ay,az)
  799.  
  800.  
  801. end
  802.  
  803.  
  804. return nil
  805.  
  806.  
  807. end
  808.  
  809.  
  810.  
  811.  
  812. function NPC(Name, Position) -- npc maker
  813.  
  814.  
  815. local Character = Instance.new("Model")
  816.  
  817.  
  818. Character.Name = Name
  819.  
  820.  
  821. local Humanoid = Instance.new("Humanoid")
  822.  
  823.  
  824. Humanoid.Parent = Character
  825.  
  826.  
  827. local Template = Instance.new("Part")
  828.  
  829.  
  830. Template.FormFactor = "Custom"
  831.  
  832.  
  833. Template.Size = Vector3.new(1, 2, 1)
  834.  
  835.  
  836. Template.Locked = true
  837.  
  838.  
  839. local Head = Template:Clone()
  840.  
  841.  
  842. Head.Name = "Head"
  843.  
  844.  
  845. Head.TopSurface = "Smooth"
  846.  
  847.  
  848. Head.BottomSurface = "Smooth"
  849.  
  850.  
  851. Head.Size = Vector3.new(2, 1, 1)
  852.  
  853.  
  854. Head.Parent = Character
  855.  
  856.  
  857. local Mesh = Instance.new("SpecialMesh")
  858.  
  859.  
  860. Mesh.MeshType = "Head"
  861.  
  862.  
  863. Mesh.Scale = Vector3.new(1.25, 1.25, 1.25)
  864.  
  865.  
  866. Mesh.Parent = Head
  867.  
  868.  
  869. local Face = Instance.new("Decal")
  870.  
  871.  
  872. Face.Name = "face"
  873.  
  874.  
  875. Face.Texture = "rbxasset://textures/face.png"
  876.  
  877.  
  878. Face.Parent = Head
  879.  
  880.  
  881. local Torso = Template:Clone()
  882.  
  883.  
  884. Torso.Name = "Torso"
  885.  
  886.  
  887. Torso.LeftSurface = "Weld"
  888.  
  889.  
  890. Torso.RightSurface = "Weld"
  891.  
  892.  
  893. Torso.CFrame = CFrame.new(0, 10000, 0)
  894.  
  895.  
  896. Torso.Size = Vector3.new(2, 2, 1)
  897.  
  898.  
  899. Torso.Parent = Character
  900.  
  901.  
  902. local TShirt = Instance.new("Decal")
  903.  
  904.  
  905. TShirt.Name = "roblox"
  906.  
  907.  
  908. TShirt.Parent = Torso
  909.  
  910.  
  911. local LeftArm = Template:Clone()
  912.  
  913.  
  914. LeftArm.Name = "Left Arm"
  915.  
  916.  
  917. LeftArm.Parent = Character
  918.  
  919.  
  920. local RightArm = Template:Clone()
  921.  
  922.  
  923. RightArm.Name = "Right Arm"
  924.  
  925.  
  926. RightArm.Parent = Character
  927.  
  928.  
  929. local LeftLeg = Template:Clone()
  930.  
  931.  
  932. LeftLeg.Name = "Left Leg"
  933.  
  934.  
  935. LeftLeg.Parent = Character
  936.  
  937.  
  938. local RightLeg = Template:Clone()
  939.  
  940.  
  941. RightLeg.Name = "Right Leg"
  942.  
  943.  
  944. RightLeg.Parent = Character
  945.  
  946.  
  947. Character:BreakJoints()
  948.  
  949.  
  950. local Neck = Instance.new("Weld")
  951.  
  952.  
  953. Neck.Name = "Neck"
  954.  
  955.  
  956. Neck.Part0 = Torso
  957.  
  958.  
  959. Neck.Part1 = Head
  960.  
  961.  
  962. Neck.C0 = CFrame.new(0, 1.5, 0)
  963.  
  964.  
  965. Neck.Parent = Torso
  966.  
  967.  
  968. local LeftShoulder = Instance.new("Motor")
  969.  
  970.  
  971. LeftShoulder.Name = "Left Shoulder"
  972.  
  973.  
  974. LeftShoulder.Part0 = Torso
  975.  
  976.  
  977. LeftShoulder.Part1 = LeftArm
  978.  
  979.  
  980. LeftShoulder.MaxVelocity = 0.1
  981.  
  982.  
  983. LeftShoulder.C0 = CFrame.new(-Torso.Size.x / 2 - RightArm.Size.x / 2, LeftArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, -math.pi / 2, 0)
  984.  
  985.  
  986. LeftShoulder.C1 = CFrame.new(0, LeftArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, -math.pi / 2, 0)
  987.  
  988.  
  989. LeftShoulder.Parent = Torso
  990.  
  991.  
  992. local RightShoulder = Instance.new("Motor")
  993.  
  994.  
  995. RightShoulder.Name = "Right Shoulder"
  996.  
  997.  
  998. RightShoulder.Part0 = Torso
  999.  
  1000.  
  1001. RightShoulder.Part1 = RightArm
  1002.  
  1003.  
  1004. RightShoulder.MaxVelocity = 0.1
  1005.  
  1006.  
  1007. RightShoulder.C0 = CFrame.new(Torso.Size.x / 2 + RightArm.Size.x / 2, RightArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
  1008.  
  1009.  
  1010. RightShoulder.C1 = CFrame.new(0, RightArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
  1011.  
  1012.  
  1013. RightShoulder.Parent = Torso
  1014.  
  1015.  
  1016. local LeftHip = Instance.new("Motor")
  1017.  
  1018.  
  1019. LeftHip.Name = "Left Hip"
  1020.  
  1021.  
  1022. LeftHip.Part0 = Torso
  1023.  
  1024.  
  1025. LeftHip.Part1 = LeftLeg
  1026.  
  1027.  
  1028. LeftHip.MaxVelocity = 0.1
  1029.  
  1030.  
  1031. LeftHip.C0 = CFrame.new(-LeftLeg.Size.x / 2, -LeftLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, -math.pi / 2, 0)
  1032.  
  1033.  
  1034. LeftHip.C1 = CFrame.new(0, LeftLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, -math.pi / 2, 0)
  1035.  
  1036.  
  1037. LeftHip.Parent = Torso
  1038.  
  1039.  
  1040. local RightHip = Instance.new("Motor")
  1041.  
  1042.  
  1043. RightHip.Name = "Right Hip"
  1044.  
  1045.  
  1046. RightHip.Part0 = Torso
  1047.  
  1048.  
  1049. RightHip.Part1 = RightLeg
  1050.  
  1051.  
  1052. RightHip.MaxVelocity = 0.1
  1053.  
  1054.  
  1055. RightHip.C0 = CFrame.new(RightLeg.Size.x / 2, -RightLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
  1056.  
  1057.  
  1058. RightHip.C1 = CFrame.new(0, RightLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
  1059.  
  1060.  
  1061. RightHip.Parent = Torso
  1062.  
  1063.  
  1064. local BodyColors = Instance.new("BodyColors")
  1065.  
  1066.  
  1067. BodyColors.LeftArmColor = BrickColor.new("Bright yellow")
  1068.  
  1069.  
  1070. BodyColors.RightArmColor = BrickColor.new("Bright yellow")
  1071.  
  1072.  
  1073. BodyColors.LeftLegColor = BrickColor.new("Br. yellowish green")
  1074.  
  1075.  
  1076. BodyColors.RightLegColor = BrickColor.new("Br. yellowish green")
  1077.  
  1078.  
  1079. BodyColors.HeadColor = BrickColor.new("Bright yellow")
  1080.  
  1081.  
  1082. BodyColors.TorsoColor = BrickColor.new("Bright blue")
  1083.  
  1084.  
  1085. BodyColors.Parent = Character
  1086.  
  1087.  
  1088. Character.Parent = Workspace
  1089.  
  1090.  
  1091. Character:MoveTo(Position)
  1092.  
  1093.  
  1094. Character:MoveTo(Torso.Position + Vector3.new(0, 3, 0))
  1095.  
  1096.  
  1097. return Character
  1098.  
  1099.  
  1100. end
  1101.  
  1102.  
  1103.  
  1104.  
  1105. AddBV=function(str,cfr,par,debt)
  1106.  
  1107.  
  1108. if not par then return end
  1109.  
  1110.  
  1111. if par:findFirstChild'LibBV' then par.LibBV:Remove() end
  1112.  
  1113.  
  1114. tbbodyvelocity=qi{'BodyVelocity',par,velocity=cfr.lookVector*str,maxForce=v3(1/0,1/0,1/0),Name='LibBV'} deb:AddItem(tbbodyvelocity,debt)
  1115.  
  1116.  
  1117. end
  1118.  
  1119.  
  1120.  
  1121.  
  1122. AddBG=function(str,par,debt)
  1123.  
  1124.  
  1125. if not par then return end
  1126.  
  1127.  
  1128. if par:findFirstChild'LibBG' then par.LibBG:Remove() end
  1129.  
  1130.  
  1131. tbbodygyro=qi{'BodyGyro',par,maxTorque=v3(1/0,1/0,1/0),P=100000,cframe=str,Name='LibBG'} deb:AddItem(tbbodygyro,debt)
  1132.  
  1133.  
  1134. end
  1135.  
  1136.  
  1137.  
  1138.  
  1139. AddBAV=function(vec3,par,debt)
  1140.  
  1141.  
  1142. if not par then return end
  1143.  
  1144.  
  1145. if par:findFirstChild'LibBAV' then par.LibBAV:Remove() end
  1146.  
  1147.  
  1148. tbbodyangularvelocity=qi{'BodyAngularVelocity',par,maxTorque=v3(1/0,1/0,1/0),angularvelocity=vec3,Name='LibBAV'} deb:AddItem(tbbodyangularvelocity,debt)
  1149.  
  1150.  
  1151. end
  1152.  
  1153.  
  1154.  
  1155.  
  1156. Dmg = function(Hum,Dealt,Critical)
  1157.  
  1158.  
  1159. local HM=Hum.Parent
  1160.  
  1161.  
  1162. local HMT,HMB=HM:findFirstChild'Torso',HM:findFirstChild'Block'
  1163.  
  1164.  
  1165. local Blocks=HMB and HMB.Value>0
  1166.  
  1167.  
  1168. if HMT then
  1169.  
  1170.  
  1171. local mm=qi{'Model',HMT} qi{'Humanoid',mm,MaxHealth=0} deb:AddItem(mm,1)
  1172.  
  1173.  
  1174. 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}
  1175.  
  1176.  
  1177. if Blocks then
  1178.  
  1179.  
  1180. mm.Name='Block!'
  1181.  
  1182.  
  1183. mp.BrickColor=bn'Bright blue'
  1184.  
  1185.  
  1186. HMB.Value=HMB.Value-1
  1187.  
  1188.  
  1189. elseif not Blocks then
  1190.  
  1191.  
  1192. mm.Name=Dealt
  1193.  
  1194.  
  1195. mp.BrickColor=bn'Bright red'
  1196.  
  1197.  
  1198. end
  1199.  
  1200.  
  1201. end
  1202.  
  1203.  
  1204. if not Blocks then
  1205.  
  1206.  
  1207. Hum:TakeDamage(Dealt)
  1208.  
  1209.  
  1210. end
  1211.  
  1212.  
  1213. end
  1214.  
  1215.  
  1216.  
  1217.  
  1218. GetHum = function(part)
  1219.  
  1220.  
  1221. local Hum,HT,block
  1222.  
  1223.  
  1224. for i,v in pairs(part.Parent:children()) do
  1225.  
  1226.  
  1227. if v:IsA("Humanoid") then
  1228.  
  1229.  
  1230. Hum=v
  1231.  
  1232.  
  1233. elseif v.Name=='Torso' then
  1234.  
  1235.  
  1236. HT=v
  1237.  
  1238.  
  1239. elseif v.Name=='Block' and v:IsA("NumberValue") then
  1240.  
  1241.  
  1242. block=v
  1243.  
  1244.  
  1245. end
  1246.  
  1247.  
  1248. end
  1249.  
  1250.  
  1251. return Hum,HT,block
  1252.  
  1253.  
  1254. end
  1255.  
  1256.  
  1257.  
  1258.  
  1259. Lightning = function(p0,p1,tym,ofs,col,th,tra) -- start end times offset color thickness
  1260.  
  1261.  
  1262. local magz = (p0 - p1).magnitude local curpos = p0 local trz = {-ofs,ofs}
  1263.  
  1264.  
  1265. for i=1,tym do
  1266.  
  1267.  
  1268. local li = it("Part",c) li.TopSurface =0 li.BottomSurface = 0 li.Anchored = true li.Transparency = tra or 0.4 li.BrickColor = bc(col)
  1269.  
  1270.  
  1271. 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)])
  1272.  
  1273.  
  1274. local trolpos = cn(curpos,p1)*cn(0,0,magz/tym).p+ofz
  1275.  
  1276.  
  1277. if tym == i then
  1278.  
  1279.  
  1280. local magz2 = (curpos - p1).magnitude li.Size = v3(th,th,magz2)
  1281.  
  1282.  
  1283. li.CFrame = cn(curpos,p1)*cn(0,0,-magz2/2)
  1284.  
  1285.  
  1286. else
  1287.  
  1288.  
  1289. li.CFrame = cn(curpos,trolpos)*cn(0,0,magz/tym/2)
  1290.  
  1291.  
  1292. end
  1293.  
  1294.  
  1295. curpos = li.CFrame*cn(0,0,magz/tym/2).p de(li,0.25)
  1296.  
  1297.  
  1298. end
  1299.  
  1300.  
  1301. end
  1302.  
  1303.  
  1304.  
  1305.  
  1306. MakeCrater = function(pos,sc,tyms,debz,par) -- crater maker
  1307.  
  1308.  
  1309. q(function()
  1310.  
  1311.  
  1312. if not debz then
  1313.  
  1314.  
  1315. debz = 5
  1316.  
  1317.  
  1318. end
  1319.  
  1320.  
  1321. local bhit,bpos=ray(pos,pos - (pos + v3(0,200,0)))
  1322.  
  1323.  
  1324. if bhit and bpos then
  1325.  
  1326.  
  1327. for i=1,tyms do
  1328.  
  1329.  
  1330. q(function()
  1331.  
  1332.  
  1333. 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)
  1334.  
  1335.  
  1336. gr.Material = bhit.Material
  1337.  
  1338.  
  1339. gr.TopSurface = bhit.TopSurface
  1340.  
  1341.  
  1342. 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)))
  1343.  
  1344.  
  1345. wait(debz)
  1346.  
  1347.  
  1348. fade(gr,0.1)
  1349.  
  1350.  
  1351. end)
  1352.  
  1353.  
  1354. end
  1355.  
  1356.  
  1357. end
  1358.  
  1359.  
  1360. end)
  1361.  
  1362.  
  1363. end
  1364.  
  1365.  
  1366.  
  1367.  
  1368. MakeCrack = function(pos,sc,debz,par) -- crackmaker
  1369.  
  1370.  
  1371. q(function()
  1372.  
  1373.  
  1374. if not debz then
  1375.  
  1376.  
  1377. debz = 5
  1378.  
  1379.  
  1380. end
  1381.  
  1382.  
  1383. local bhit,bpos=ray(pos,pos - (pos + v3(0,10,0)))
  1384.  
  1385.  
  1386. if bhit and bpos then
  1387.  
  1388.  
  1389. local cr = pa(par or workspace,"Crack","Block",sc,0,sc,false,true,1,0,"") cr.CFrame = cn(bpos)
  1390.  
  1391.  
  1392. local dec=qi({"Decal",cr,Face="Top",Texture=ds.Crack}) de(cr,debz)
  1393.  
  1394.  
  1395. end
  1396.  
  1397.  
  1398. end)
  1399.  
  1400.  
  1401. end
  1402.  
  1403.  
  1404.  
  1405.  
  1406. a = {}
  1407.  
  1408.  
  1409. a.insw={}
  1410.  
  1411.  
  1412. function cleanweld(wexx,namzi)
  1413.  
  1414.  
  1415. local tn=ft2(a.insw,wexx)
  1416.  
  1417.  
  1418. if tn==nil then return end
  1419.  
  1420.  
  1421. if namzi=="p0" then
  1422.  
  1423.  
  1424. a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]=0,0,0 elseif namzi=="p1" then
  1425.  
  1426.  
  1427. a.insw[tn][2]["p1x"],a.insw[tn][2]["p1y"],a.insw[tn][2]["p1z"]=0,0,0 elseif namzi=="a0" then
  1428.  
  1429.  
  1430. a.insw[tn][2]["a0x"],a.insw[tn][2]["a0y"],a.insw[tn][2]["a0z"]=0,0,0 elseif namzi=="a1" then
  1431.  
  1432.  
  1433. a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]=0,0,0
  1434.  
  1435.  
  1436. end
  1437.  
  1438.  
  1439. end
  1440.  
  1441.  
  1442. function c2(wexx,smmx,c0orc1,aa,bb,cc,xx,yy,zz)
  1443.  
  1444.  
  1445. q(function()
  1446.  
  1447.  
  1448. c1(wexx,smmx,c0orc1,aa,bb,cc,xx,yy,zz)
  1449.  
  1450.  
  1451. end)
  1452.  
  1453.  
  1454. end
  1455.  
  1456.  
  1457. a.Welding=0
  1458.  
  1459.  
  1460. function c1(wexx,smmx,c0orc1,aa,bb,cc,xx,yy,zz)
  1461.  
  1462.  
  1463. if ft2(a.insw,wexx)==nil then
  1464.  
  1465.  
  1466. ti(a.insw,{wexx,{}})
  1467.  
  1468.  
  1469. local tn=ft2(a.insw,wexx)
  1470.  
  1471.  
  1472. a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]=wexx.C0.x,wexx.C0.y,wexx.C0.z
  1473.  
  1474.  
  1475. a.insw[tn][2]["p1x"],a.insw[tn][2]["p1y"],a.insw[tn][2]["p1z"]=wexx.C1.x,wexx.C1.y,wexx.C1.z
  1476.  
  1477.  
  1478. a.insw[tn][2]["a0x"],a.insw[tn][2]["a0y"],a.insw[tn][2]["a0z"]=wexx.C0:toEulerAnglesXYZ()
  1479.  
  1480.  
  1481. a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]=wexx.C1:toEulerAnglesXYZ()
  1482.  
  1483.  
  1484. end
  1485.  
  1486.  
  1487. local tn=ft2(a.insw,wexx)
  1488.  
  1489.  
  1490. local xx2,yy2,zz2=0,0,0
  1491.  
  1492.  
  1493. local x2,y2,z2=0,0,0
  1494.  
  1495.  
  1496. if c0orc1==0 then
  1497.  
  1498.  
  1499. xx2,yy2,zz2=a.insw[tn][2]["a0x"],a.insw[tn][2]["a0y"],a.insw[tn][2]["a0z"]
  1500.  
  1501.  
  1502. x2,y2,z2=a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]
  1503.  
  1504.  
  1505. elseif c0orc1==1 then
  1506.  
  1507.  
  1508. xx2,yy2,zz2=a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]
  1509.  
  1510.  
  1511. x2,y2,z2=a.insw[tn][2]["p1x"],a.insw[tn][2]["p1y"],a.insw[tn][2]["p1z"]
  1512.  
  1513.  
  1514. else
  1515.  
  1516.  
  1517. xx2,yy2,zz2=a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]
  1518.  
  1519.  
  1520. x2,y2,z2=a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]
  1521.  
  1522.  
  1523. end a.Welding=a.Welding + 1
  1524.  
  1525.  
  1526. local twa=1
  1527.  
  1528.  
  1529. if smmx >= 1 then
  1530.  
  1531.  
  1532. else
  1533.  
  1534.  
  1535. for i=smmx,0.8,smmx do
  1536.  
  1537.  
  1538. twa = 1
  1539.  
  1540.  
  1541. if c0orc1==0 then
  1542.  
  1543.  
  1544. 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))
  1545.  
  1546.  
  1547. elseif c0orc1==1 then
  1548.  
  1549.  
  1550. 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))
  1551.  
  1552.  
  1553. else local x,y,z = wexx.C0:toEulerAnglesXYZ()
  1554.  
  1555.  
  1556. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i))*ca(x,y,z)
  1557.  
  1558.  
  1559. 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))
  1560.  
  1561.  
  1562. end
  1563.  
  1564.  
  1565. if fu then
  1566.  
  1567.  
  1568. q(fu)
  1569.  
  1570.  
  1571. end
  1572.  
  1573.  
  1574. wait()
  1575.  
  1576.  
  1577. end
  1578.  
  1579.  
  1580. for i=0.8,1,smmx*0.45 do
  1581.  
  1582.  
  1583. twa = 1
  1584.  
  1585.  
  1586. if c0orc1==0 then
  1587.  
  1588.  
  1589. 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))
  1590.  
  1591.  
  1592. elseif c0orc1==1 then
  1593.  
  1594.  
  1595. 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))
  1596.  
  1597.  
  1598. else local x,y,z = wexx.C0:toEulerAnglesXYZ()
  1599.  
  1600.  
  1601. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i))*ca(x,y,z)
  1602.  
  1603.  
  1604. 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))
  1605.  
  1606.  
  1607. end
  1608.  
  1609.  
  1610. wait()
  1611.  
  1612.  
  1613. end
  1614.  
  1615.  
  1616. end
  1617.  
  1618.  
  1619. local i=1
  1620.  
  1621.  
  1622. if c0orc1==0 then
  1623.  
  1624.  
  1625. 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))
  1626.  
  1627.  
  1628. elseif c0orc1==1 then
  1629.  
  1630.  
  1631. 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))
  1632.  
  1633.  
  1634. else local x,y,z = wexx.C0:toEulerAnglesXYZ()
  1635.  
  1636.  
  1637. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i))*ca(x,y,z)
  1638.  
  1639.  
  1640. 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))
  1641.  
  1642.  
  1643. end
  1644.  
  1645.  
  1646. a.Welding=a.Welding - 1
  1647.  
  1648.  
  1649. local tn=ft2(a.insw,wexx)
  1650.  
  1651.  
  1652. if c0orc1==0 then
  1653.  
  1654.  
  1655. 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)
  1656.  
  1657.  
  1658. 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)
  1659.  
  1660.  
  1661. elseif c0orc1==1 then
  1662.  
  1663.  
  1664. 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)
  1665.  
  1666.  
  1667. 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)
  1668.  
  1669.  
  1670. elseif c0orc1==3 then
  1671.  
  1672.  
  1673. local x,y,z=wexx.C0.x,wexx.C0.y,wexx.C0.z
  1674.  
  1675.  
  1676. 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)
  1677.  
  1678.  
  1679. local x,y,z=wexx.C1:toEulerAnglesXYZ()
  1680.  
  1681.  
  1682. 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)
  1683.  
  1684.  
  1685. end
  1686.  
  1687.  
  1688. end
  1689.  
  1690.  
  1691.  
  1692.  
  1693. Welds={}
  1694.  
  1695.  
  1696. Ani=function(w,a,b,c,d,e,f,ty,inc,sined)
  1697.  
  1698.  
  1699. if not Welds[w] then
  1700.  
  1701.  
  1702. local d0,e0,f0=w.C0:toEulerAnglesXYZ() local d1,e1,f1=w.C1:toEulerAnglesXYZ()
  1703.  
  1704.  
  1705. local d0,e0,f0=mdeg(d0),mdeg(e0),mdeg(f0) local d1,e1,f1=mdeg(d1),mdeg(e1),mdeg(f1)
  1706.  
  1707.  
  1708. 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}}
  1709.  
  1710.  
  1711. end
  1712.  
  1713.  
  1714. local c0,c1=Welds[w][0],Welds[w][1]
  1715.  
  1716.  
  1717. c0[1],c0[2],c0[3]=w.C0.x,w.C0.y,w.C0.z
  1718.  
  1719.  
  1720. c1[1],c1[2],c1[3]=w.C1.x,w.C1.y,w.C1.z
  1721.  
  1722.  
  1723. local A0,B0,C0,D0,E0,F0 = unpack(c0)
  1724.  
  1725.  
  1726. local A1,B1,C1,D1,E1,F1 = unpack(c1)
  1727.  
  1728.  
  1729. local Do = function(i)
  1730.  
  1731.  
  1732. if ty==0 then
  1733.  
  1734.  
  1735. 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) )
  1736.  
  1737.  
  1738. elseif ty==1 then
  1739.  
  1740.  
  1741. 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) )
  1742.  
  1743.  
  1744. else
  1745.  
  1746.  
  1747. w.C0=cn( A0-((A0-a)*i) , B0-((B0-b)*i) , C0-((C0-c)*i) ) * ca2(D0,E0,F0)
  1748.  
  1749.  
  1750. w.C1=cn(A1,B1,C1) * ca2( D1-((D1-d)*i) , E1-(((E1-e)/1)*i) , F1-((F1-f)*i) )
  1751.  
  1752.  
  1753. end
  1754.  
  1755.  
  1756. end
  1757.  
  1758.  
  1759. for i=inc,1,inc do
  1760.  
  1761.  
  1762. Do(sined and math.sin(math.pi/2*i) or i)
  1763.  
  1764.  
  1765. wait()
  1766.  
  1767.  
  1768. end
  1769.  
  1770.  
  1771. Do(1)
  1772.  
  1773.  
  1774. if ty==0 then
  1775.  
  1776.  
  1777. c0[4],c0[5],c0[6]=d,e,f
  1778.  
  1779.  
  1780. else
  1781.  
  1782.  
  1783. c1[4],c1[5],c1[6]=d,e,f
  1784.  
  1785.  
  1786. end
  1787.  
  1788.  
  1789. end
  1790.  
  1791.  
  1792. 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
  1793.  
  1794.  
  1795. rAni=function(w)
  1796.  
  1797.  
  1798. Welds[w]=nil
  1799.  
  1800.  
  1801. end
  1802.  
  1803.  
  1804.  
  1805.  
  1806. gunshot = function(speed,sc,dmg,cff) q(function() -- gunshot function
  1807.  
  1808.  
  1809. local bb = pa(workspace,"bullet","Block",0.2*sc,0.3*sc,0.2*sc,true,true,0,0.1,"Black") qi({"CylinderMesh",bb})
  1810.  
  1811.  
  1812. bb.CFrame = cff*ca(rd(rn(-1000,1000)/1500),rd(rn(-1000,1000)/1500),rd(rn(-1000,1000)/1500))
  1813.  
  1814.  
  1815. so(ds.Fire,bb,0.3,1) wait() for i=1,50 do
  1816.  
  1817.  
  1818. bhit,bpos=ray(bb.Position,bb.Position - (bb.CFrame *cn(0,-1,0)).p)
  1819.  
  1820.  
  1821. if bhit and bhit.Name ~= "bullet" and bhit.Name ~= "bullethole" and bpos and (bpos - bb.Position).magnitude < speed then break end
  1822.  
  1823.  
  1824. bb.CFrame=bb.CFrame*cn(0,speed,0)*ca(rd(-0.2),0,0)
  1825.  
  1826.  
  1827. wait()
  1828.  
  1829.  
  1830. end bb.CFrame=bb.CFrame*cn(0,(bpos-bb.Position).magnitude,0)
  1831.  
  1832.  
  1833. if not bhit.Anchored then
  1834.  
  1835.  
  1836. if bhit.Parent:findFirstChild("Humanoid") then local h = bhit.Parent.Humanoid h.Health=h.Health-dmg so(ds.Hit,bhit,0.3,1) end
  1837.  
  1838.  
  1839. else if bhit.Name~="Base" then bhit.Anchored=false bhit:BreakJoints() end end bb:Remove()
  1840.  
  1841.  
  1842. if bhit.Parent:findFirstChild("Humanoid") == nil then BulletHole(bpos,bhit,0.7*sc) end
  1843.  
  1844.  
  1845. end) end
  1846.  
  1847.  
  1848.  
  1849.  
  1850. dive = function(ob2,pro,ite,stof)
  1851.  
  1852.  
  1853. local function div(ob) for i,v in pairs(ob:children()) do if v[pro] == ite then
  1854.  
  1855.  
  1856. for i=1,#stof do v[stof[i][1]] = stof[i][2] end else div(v) end end end
  1857.  
  1858.  
  1859. div(ob2)
  1860.  
  1861.  
  1862. end
  1863.  
  1864.  
  1865.  
  1866.  
  1867. fc = function(ob,cl)
  1868.  
  1869.  
  1870. for i,v in pairs(ob:children()) do if v.className:lower()==cl:lower() then return v end end
  1871.  
  1872.  
  1873. end
  1874.  
  1875.  
  1876.  
  1877.  
  1878. function se(Key,Text)
  1879.  
  1880.  
  1881. local Values = {}
  1882.  
  1883.  
  1884. for value in (Text..Key):gmatch("(.-)"..Key) do
  1885.  
  1886.  
  1887. table.insert(Values,value)
  1888.  
  1889.  
  1890. end return Values
  1891.  
  1892.  
  1893. end
  1894.  
  1895.  
  1896.  
  1897.  
  1898. local thefenv = getfenv()
  1899.  
  1900.  
  1901. getfenv()["rmhelp"] = function()
  1902.  
  1903.  
  1904. local nus = 0
  1905.  
  1906.  
  1907. for i,v in pairs(thefenv) do if i ~= "wait" and i ~= "script" then nus = nus + 1 wait(0.05)
  1908.  
  1909.  
  1910. print(string.rep(" ",3-#tostring(nus)) ..nus.. ") " ..i.. " (" ..type(v).. ")")
  1911.  
  1912.  
  1913. end
  1914.  
  1915.  
  1916. end
  1917.  
  1918.  
  1919. end
  1920.  
  1921.  
  1922.  
  1923.  
  1924. for i,v in pairs(thefenv) do
  1925.  
  1926.  
  1927. _G[i] = v
  1928.  
  1929.  
  1930. --print(i)
  1931.  
  1932.  
  1933. end
  1934.  
  1935.  
  1936.  
  1937.  
  1938. _G[" r".."m".."d".."x "] = [[
  1939.  
  1940.  
  1941. for i,v in pairs(_G) do
  1942.  
  1943.  
  1944. if i ~= "wait" and i ~= "script" then
  1945.  
  1946.  
  1947. getfenv()[i] = v
  1948.  
  1949.  
  1950. end
  1951.  
  1952.  
  1953. end
  1954.  
  1955.  
  1956. ]]
  1957.  
  1958. script:ClearAllChildren()
  1959. Player=game:GetService("Players").LocalPlayer
  1960. Char=Player.Character
  1961. Backpack=Player.Backpack
  1962. PlayerGui=Player.PlayerGui
  1963. Torso=Char.Torso
  1964. Head=Char.Head
  1965. Hum=Char.Humanoid
  1966. Cam=workspace.CurrentCamera
  1967. Tn="Pipebomb Launcher"
  1968. pcall(function() Backpack[Tn]:Remove() end)
  1969. pcall(function() Cam[Tn]:Remove() end)
  1970. pcall(function() thesuit=Char[''] end)
  1971. pcall(function() thesuit[Tn]:Remove() end)
  1972. pcall(function() PlayerGui[Tn]:Remove() end)
  1973. CModel=qi{'Model',Cam,Name=Tn}
  1974. Tool=qi{'HopperBin',Player.Backpack,Name=Tn}
  1975. Suit=qi{'Model',Char,Name=''}
  1976. Weapon=qi{'Model',Suit,Name=Tn}
  1977. Gui=qi{'ScreenGui',PlayerGui,Name=Tn}
  1978. equip="unequipped"
  1979. anim=""
  1980. keys={}
  1981. fmouse=nil
  1982. PipeRotate=0
  1983. Clip=6
  1984. LastShot=0
  1985. ids = {}
  1986. ids.Shoot = 10209633
  1987. ids.Reload = 10209636
  1988. ids.Crown = 20329976
  1989. ids.Crown2 = 1323306
  1990. ids.Icon = 52611635
  1991. ids.Explode = 2697431
  1992. ids.Ring = 3270017
  1993. for i,v in pairs(ids) do
  1994. if type(v)=='number' then
  1995. ids[i]='http://www.roblox.com/asset/?id='..v
  1996. end
  1997. game:GetService("ContentProvider"):Preload(ids[i])
  1998. end
  1999. Limbs={LS=Torso:findFirstChild'Left Shoulder',RS=Torso:findFirstChild'Right Shoulder',LH=Torso:findFirstChild'Left Hip',RH=Torso:findFirstChild'Right Hip'}
  2000. if _G.Limbz then
  2001. Limbs.LS=Limbs.LS or _G.Limbz.LS
  2002. Limbs.RS=Limbs.RS or _G.Limbz.RS
  2003. Limbs.LH=Limbs.LH or _G.Limbz.LH
  2004. Limbs.RH=Limbs.RH or _G.Limbz.RH
  2005. end
  2006. _G.Limbz=Limbs
  2007. Torso.Neck.C0=cn(0,1.5,0) Torso.Neck.C1=cn(0,0,0)
  2008. c2(Torso.Neck,1,3,0,1.5,0,0,0,0)
  2009. LS,RS,LH,RH=Limbs.LS,Limbs.RS,Limbs.LH,Limbs.RH
  2010. LA,RA,LL,RL=Char['Left Arm'],Char['Right Arm'],Char['Left Leg'],Char['Right Leg']
  2011. LS.Part0,RS.Part0,LH.Part0,RH.Part0=Torso,Torso,Torso,Torso
  2012. LS.Part1,RS.Part1,LH.Part1,RH.Part1=LA,RA,LL,RL
  2013. pcall(function() thesuit:Remove() end)
  2014. Head.face.Transparency=0
  2015. Head.Transparency=1 Torso.Transparency=1
  2016. fTorso=pa(Suit,"FTorso","Block",2,2,1,false,false,0,0,Torso.BrickColor.Name) neck=Torso.Neck
  2017. tw=weld(fTorso,Torso,fTorso,0,0,0,0,0,0) qi{"BlockMesh",fTorso}
  2018. fHead=pa(Suit,"FHead","Block",2,1,1,false,false,0,0,Head.BrickColor.Name)
  2019. 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
  2020. 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)}
  2021. 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)}
  2022. newhats(Char,fHead,Head) ClearClass(Char,"Hat") Hum.WalkSpeed=16 Hum.MaxHealth=175
  2023. Armz=false
  2024. Legz=false
  2025. Arms = function(on) Armz=on
  2026. if on then
  2027. LS.Part1=nil RS.Part1=nil
  2028. la.Part0=fTorso ra.Part0=fTorso
  2029. la.Part1=LA ra.Part1=RA
  2030. la.C0,la.C1=cn(-1.5,0.5,0),cn(0,0.5,0)
  2031. ra.C0,ra.C1=cn(1.5,0.5,0),cn(0,0.5,0)
  2032. else
  2033. LS.Parent,RS.Parent=fTorso,fTorso LS.Part0=fTorso RS.Part0=fTorso LS.Part1=LA RS.Part1=RA
  2034. la.Part1=nil ra.Part1=nil
  2035. end
  2036. end
  2037. Legs = function(on) Legz=on
  2038. if on then
  2039. LH.Part1=nil RH.Part1=nil
  2040. ll.Part0=fTorso rl.Part0=fTorso
  2041. ll.Part1=LL rl.Part1=RL
  2042. ll.C0,ll.C1=cn(-0.5,-1,0),cn(0,1,0)
  2043. rl.C0,rl.C1=cn(0.5,-1,0),cn(0,1,0)
  2044. else
  2045. LH.Parent,RH.Parent=fTorso,fTorso LH.Part0=fTorso RH.Part0=fTorso LH.Part1=LL RH.Part1=RL
  2046. ll.Part1=nil rl.Part1=nil
  2047. end
  2048. end
  2049. Arms'' Legs''
  2050. WDesign=function(c)
  2051. 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))
  2052. 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'}
  2053. 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)}
  2054. 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)
  2055. 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)
  2056. 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)
  2057. 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)}
  2058. 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)}
  2059. 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}
  2060. 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)
  2061. 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}
  2062. 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)}
  2063. 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}
  2064. 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)}
  2065. 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)}
  2066. 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)}
  2067. 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"}
  2068. 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"}
  2069. 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}
  2070. 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"}
  2071. 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}
  2072. 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"}
  2073. 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"}
  2074. 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}
  2075. 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}
  2076. 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}
  2077. for i=0,360,360/6 do
  2078. 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)
  2079. 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)
  2080. 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)
  2081. end
  2082. 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)}
  2083. 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)}
  2084. 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"}
  2085. 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)}
  2086. 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"}
  2087. 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)}
  2088. 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
  2089. 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}
  2090. 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)}
  2091. 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)}
  2092. 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)
  2093. 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"}
  2094. for i,v in pairs(Weapon:GetChildren()) do v.CanCollide=false end
  2095. end
  2096. WDesign({"Reddish brown","Really black","Dark stone grey","White","Medium stone grey","Really black"}) Arms(false) Legs(false)
  2097. BBD,BBT=0,{}
  2098. Dealt={20,40}
  2099. function Destroy(Directory,Part,Distance)
  2100. for i,v in pairs(Directory:GetChildren()) do
  2101. 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
  2102. if (Part.Position-v.Position).magnitude<=Distance and v:GetMass()<=1000 then
  2103. v.Anchored=false
  2104. v:BreakJoints()
  2105. v.CFrame=cn(v.Position,Part.Position)*ca(0,rd(180),0)
  2106. v.Velocity=cn(Part.Position,v.Position).lookVector*50
  2107. end
  2108. elseif v:IsA("Model") or v:IsA("Script") or v:IsA("BasePart") and v.Name=="Base" then
  2109. Destroy(v,Part,Distance)
  2110. end
  2111. end
  2112. end
  2113. SplashDmg=function(Part,Distance)
  2114. q(function()
  2115. qi{"Explosion",workspace,Position=Part.Position,BlastPressure=0}
  2116. for i,v in pairs(workspace:GetChildren()) do
  2117. if v:FindFirstChild("Torso",true) then
  2118. local vTorso=v:FindFirstChild("Torso",true)
  2119. if (vTorso.Position-Part.Position).magnitude<=Distance then
  2120. local vHum=GetHum(vTorso)
  2121. if not vHum or BBD==0 or BBT[vHum.Parent] then return end
  2122. BBT[vHum.Parent]=1
  2123. if rn(1,20)==1 then
  2124. Dmg(vHum,rn(Dealt[1],Dealt[2])*3,true)
  2125. else
  2126. Dmg(vHum,rn(Dealt[1],Dealt[2]),false)
  2127. end
  2128. if BBD==2 and vTorso then
  2129. vHum.PlatformStand=true
  2130. if vHum.Jump then
  2131. AddBV(120,cn(Part.Position,vTorso.Position),vTorso,0.4)
  2132. else
  2133. AddBV(100,cn(Part.Position,vTorso.Position),vTorso,0.4)
  2134. end
  2135. if vTorso.Parent~=Char then
  2136. AddBAV(v3(rn(-50,50),rn(-50,50),rn(-50,50)),vTorso,0.4)
  2137. end
  2138. q(function()
  2139. wait(0.6)
  2140. vHum.PlatformStand=false
  2141. end)
  2142. end
  2143. so(ids.Hit,vTorso,1,1)
  2144. BBT[vHum.Parent]=nil
  2145. end
  2146. end
  2147. end
  2148. end)
  2149. end
  2150. Fire = function(speed,sc,cff,dest)
  2151. q(function()
  2152. 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}
  2153. 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)}
  2154. 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)}
  2155. 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)}
  2156. bb.CFrame = cn(cff.p,dest)*ca(rd(-90),0,0)
  2157. 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)
  2158. 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)
  2159. for i=1,100 do
  2160. bhit,bpos=ray(bb.Position,bb.Position - (bb.CFrame *cn(0,-2,0)).p)
  2161. bhit2,bpos2=ray(pp0.Position,pp0.Position - (pp0.CFrame *cn(0,-2,0)).p)
  2162. bhit3,bpos3=ray(pp1.Position,bb.Position - (pp1.CFrame *cn(0,-2,0)).p)
  2163. bhit4,bpos4=ray(pp2.Position,pp0.Position - (pp2.CFrame *cn(0,-2,0)).p)
  2164. 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
  2165. 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
  2166. 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
  2167. 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
  2168. bb.CFrame=bb.CFrame*cn(0,speed,0)*ca(rd(-0.3),0,0)
  2169. pp0.CFrame=bb.CFrame*cn(0,0.3,0)
  2170. pp1.CFrame=bb.CFrame*cn(0,-0.3,0)
  2171. pp2.CFrame=bb.CFrame*cn(0,0.1,0)
  2172. wait()
  2173. end
  2174. GlowMesh(false,"sphere",Weapon,v3(3,3,3),"Bright red",cn(bpos),0.25,1,0.05)
  2175. BBD=2
  2176. sopart=pa(workspace,"bullet","Block",0,0,0,true,true,1,0)
  2177. bb.CFrame=bb.CFrame*cn(0,(bpos-bb.Position).magnitude,0)
  2178. pp0.CFrame=bb.CFrame*cn(0,0.3,0)
  2179. pp1.CFrame=bb.CFrame*cn(0,-0.3,0)
  2180. pp2.CFrame=bb.CFrame*cn(0,0.1,0)
  2181. sopart.CFrame=bb.CFrame
  2182. so(ids.Explode,sopart,1,0.4)
  2183. SplashDmg(bb,11)
  2184. Destroy(workspace,bb,13)
  2185. BBD=0
  2186. deb:AddItem(bb,1)
  2187. deb:AddItem(sopart,1)
  2188. end)
  2189. end
  2190. function Stance(speed)
  2191. c2(ra,speed,3,1.25,0.5,-0.25,-75,-65,0)
  2192. c2(la,speed,3,-1.25,0.5,-0.25,-70,-20,0)
  2193. c2(ll,speed,3,-0.5,-1,0,0,0,0)
  2194. c2(rl,speed,3,0.5,-1,0,0,0,0)
  2195. c2(hw,speed,3,0,1.5,0,0,-65,0)
  2196. c2(tw,speed,3,0,0,0,0,65,0)
  2197. c2(neck,speed,3,0,1.5,0,0,0,0)
  2198. c2(hingew,speed,3,0,0,0,0,0,0)
  2199. c2(piperw,speed,3,0,0.7,0,0,30+PipeRotate,0)
  2200. Ani(haw,0,0.5,0,-75,0,0,0,speed/2,1)
  2201. end
  2202. function Reset(speed)
  2203. c2(ra,speed,3,1.5,0.5,0,0,0,0)
  2204. c2(la,speed,3,-1.5,0.5,0,0,0,0)
  2205. c2(ll,speed,3,-0.5,-1,0,0,0,0)
  2206. c2(rl,speed,3,0.5,-1,0,0,0,0)
  2207. c2(hw,speed,3,0,1.5,0,0,0,0)
  2208. c2(tw,speed,3,0,0,0,0,0,0)
  2209. c2(neck,speed,3,0,1.5,0,0,0,0)
  2210. c2(piperw,speed,3,0,0.7,0,0,30+PipeRotate,0)
  2211. c2(hingew,speed,3,0,0,0,0,0,0)
  2212. Ani(haw,0.5,2.5,1,270,0,90,0,speed,1)
  2213. end
  2214. function Button1Down()
  2215. if Clip>0 and anim=="" and (tick()-LastShot)>=0.6 then
  2216. LastShot=tick()
  2217. so(ids.Shoot,ha,1,1)
  2218. Fire(3,1,p25.CFrame*cn(0,-1,0),fmouse.Hit.p)
  2219. Clip=Clip-1
  2220. PipeRotate=PipeRotate+60
  2221. c2(piperw,0.4,3,0,0.7,0,0,30+PipeRotate,0)
  2222. elseif Clip==0 and anim=="" and (tick()-LastShot)>=0.6 then
  2223. anim="Reloading"
  2224. c2(ra,0.1,3,1.25,0.5,-0.25,-75,-65,0)
  2225. c2(la,0.1,3,-1.25,0.5,-0.25,-70,-20,0)
  2226. c2(hw,0.1,3,0,1.5,0,0,-65,0)
  2227. c1(hingew,0.15,3,0,0,0,0,-90,0)
  2228. for i=1,6 do
  2229. PipeRotate=PipeRotate+60
  2230. c1(la,0.13,3,-1.25,0.25,0.1,15,0,-15)
  2231. 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}
  2232. 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"}
  2233. 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)}
  2234. 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}
  2235. c1(la,0.16,3,-1.25,0.4,-0.1,-100,0,-15)
  2236. c1(la,0.2,3,-1.25,0.3,-0.25,-40,0,-15)
  2237. so(ids.Reload,ha,1,1)
  2238. c1(piperw,0.4,3,0,0.7,0,0,30+PipeRotate,0)
  2239. Clip=i
  2240. deb:AddItem(pipe,0.05)
  2241. end
  2242. Stance(0.15)
  2243. anim=""
  2244. end
  2245. end
  2246. function KeyDown(key)
  2247. key=key:lower()
  2248. keys[key]=true
  2249. if key=="r" and anim=="" and equip=="equipped" and Clip==0 then
  2250. anim="Reloading"
  2251. c2(ra,0.1,3,1.25,0.5,-0.25,-75,-65,0)
  2252. c2(la,0.1,3,-1.25,0.5,-0.25,-70,-20,0)
  2253. c2(hw,0.1,3,0,1.5,0,0,-65,0)
  2254. c1(hingew,0.15,3,0,0,0,0,-90,0)
  2255. for i=1,6 do
  2256. PipeRotate=PipeRotate+60
  2257. c1(la,0.13,3,-1.25,0.25,0.1,15,0,-15)
  2258. 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}
  2259. 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"}
  2260. 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)}
  2261. 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}
  2262. c1(la,0.16,3,-1.25,0.4,-0.1,-100,0,-15)
  2263. c1(la,0.2,3,-1.25,0.3,-0.25,-40,0,-15)
  2264. so(ids.Reload,ha,1,1)
  2265. c1(piperw,0.4,3,0,0.7,0,0,30+PipeRotate,0)
  2266. Clip=i
  2267. deb:AddItem(pipe,0.05)
  2268. end
  2269. Stance(0.15)
  2270. anim=""
  2271. end
  2272. end
  2273. Tool.Selected:connect(function(mouse)
  2274. fmouse=mouse
  2275. if equip=="unequipped" and anim=="" then
  2276. 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)
  2277. local ofs = RA.CFrame:toObjectSpace(ha.CFrame)
  2278. haw.Part0=RA haw.C0=ofs haw.C1=cn(0,0,0) rAni(haw)
  2279. Stance(0.2) equip="equipped"
  2280. end
  2281. mouse.Button1Down:connect(Button1Down)
  2282. mouse.KeyDown:connect(KeyDown)
  2283. end)
  2284. Tool.Deselected:connect(function()
  2285. fmouse=nil
  2286. if equip=="equipped" and anim=="" then
  2287. 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)
  2288. local ofs = Torso.CFrame:toObjectSpace(ha.CFrame)
  2289. haw.Part0=Torso haw.C0=ofs haw.C1=cn(0,0,0) rAni(haw)
  2290. Reset(0.1)
  2291. Arms(false) Legs(false) equip="unequipped"
  2292. end
  2293. end)
  2294. Gyro=qi{"BodyGyro",Torso,D=50,P=1500}
  2295. game:GetService("RunService").Stepped:connect(function()
  2296. if fmouse~=nil then
  2297. Gyro.maxTorque=v3(1/0,1/0,1/0)
  2298. Gyro.cframe = cn(Torso.Position,v3(fmouse.hit.p.x,Torso.Position.y,fmouse.hit.p.z))
  2299. else
  2300. Gyro.maxTorque = v3(0,0,0)
  2301. end
  2302. if equip=="equipped" and anim=="" and fmouse~=nil then
  2303. c2(ra,1,3,1.25,0.5,-0.25,-75+math.deg((Torso.Position-fmouse.Hit.p).unit.y),-65,0)
  2304. c2(la,1,3,-1.25,0.5,-0.25,-70+math.deg((Torso.Position-fmouse.Hit.p).unit.y),-20,0)
  2305. c2(hw,1,3,0,1.5,0,math.deg((Torso.Position-fmouse.Hit.p).unit.y),-65,0)
  2306. end
  2307. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement