Advertisement
Guest User

Untitled

a guest
Apr 20th, 2015
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.22 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. script.Parent = nil
  8.  
  9.  
  10.  
  11. it = Instance.new
  12.  
  13. v3=Vector3.new
  14.  
  15. bc=BrickColor.new
  16.  
  17. c3=Color3.new
  18.  
  19. cn=CFrame.new
  20.  
  21. ca=CFrame.Angles
  22.  
  23. ca2=function(a,b,c)
  24.  
  25. return ca(math.rad(a),math.rad(b),math.rad(c))
  26.  
  27. end
  28.  
  29. ti=table.insert
  30.  
  31. tr=table.remove
  32.  
  33. rn=math.random
  34.  
  35. rd=math.rad
  36.  
  37. mf=math.floor
  38.  
  39. ud = UDim2.new
  40.  
  41. inf=math.huge
  42.  
  43. dg=math.deg
  44.  
  45. mdeg=math.deg
  46.  
  47. v310=v3(1/0,1/0,1/0)
  48.  
  49. pi=math.pi
  50.  
  51. w=wait
  52.  
  53. cf=cn
  54.  
  55. bn=bc
  56.  
  57. ts=tostring
  58.  
  59.  
  60.  
  61. Workspace=game:GetService("Workspace")
  62.  
  63. Players=game:GetService("Players")
  64.  
  65. Player=Players.LocalPlayer
  66.  
  67. Lighting=game:GetService("Lighting")
  68.  
  69. Debris=game:GetService("Debris")
  70.  
  71.  
  72.  
  73. work=Workspace
  74.  
  75. server=Players
  76.  
  77. tb=Player
  78.  
  79. lighting=Lighting
  80.  
  81. deb=Debris
  82.  
  83.  
  84.  
  85. asset = "http://www.roblox.com/asset/?id="
  86.  
  87. Asset=asset
  88.  
  89.  
  90.  
  91. ids = {}
  92.  
  93. ids.Shoot = 10209633
  94.  
  95. ids.Reload = 10209636
  96.  
  97. ids.Crown = 20329976
  98.  
  99. ids.Crown2 = 1323306
  100.  
  101. ids.Icon = 52611635
  102.  
  103. ids.Explode = 2697431
  104.  
  105. ids.Ring = 3270017
  106.  
  107.  
  108.  
  109. for i,v in pairs(ids) do
  110.  
  111. if type(v)=='number' then
  112.  
  113. ids[i]='http://www.roblox.com/asset/?id='..v
  114.  
  115. end
  116.  
  117. game:GetService("ContentProvider"):Preload(ids[i])
  118.  
  119. end
  120.  
  121.  
  122.  
  123. qi = function(ttz)
  124.  
  125. local qii = it(ttz[1]) table.foreach(ttz,function(oi,oi2)
  126.  
  127. if oi ~= 1 and oi ~= 2 then qii[oi] = oi2 end end) qii.Parent=ttz[2] return qii end
  128.  
  129.  
  130.  
  131. q = function(f)
  132.  
  133. coroutine.resume(coroutine.create(function() f() end)) end
  134.  
  135.  
  136.  
  137. ft = function(tablez,item)
  138.  
  139. for i=1,#tablez do if tablez[i] == item then return i end end return nil end
  140.  
  141.  
  142.  
  143. ft2 = function(tablez,item)
  144.  
  145. for i=1,#tablez do if tablez[i][1] == item then return i end end return nil end
  146.  
  147.  
  148.  
  149. pa = function(pa,pn,sh,x,y,z,c,a,tr,re,bc2)
  150.  
  151. local fp=nil
  152.  
  153. if sh ~= "Wedge" and sh ~= "CornerWedge" and sh ~= "VehicleSeat" and sh ~= "Seat" then
  154.  
  155. fp=it("Part",pa)
  156.  
  157. fp.Shape=sh or "Block"
  158.  
  159. fp.formFactor="Custom"
  160.  
  161. elseif sh == "Wedge" then
  162.  
  163. fp=it("WedgePart",pa)
  164.  
  165. fp.formFactor="Custom"
  166.  
  167. elseif sh == "CornerWedge" then
  168.  
  169. fp=it("CornerWedgePart",pa)
  170.  
  171. elseif sh == "VehicleSeat" then
  172.  
  173. fp=it("VehicleSeat",pa)
  174.  
  175. elseif sh == "Seat" then
  176.  
  177. fp=it("Seat",pa)
  178.  
  179. end
  180.  
  181. fp.Size=v3(x or 4,y or 2,z or 2)
  182.  
  183. fp.Friction = 2
  184.  
  185. fp.CanCollide=c or true
  186.  
  187. fp.Anchored=a or false
  188.  
  189. fp.BrickColor=bc(bc2 or "")
  190.  
  191. fp.Transparency=tr or 0
  192.  
  193. fp.Reflectance=re or 0
  194.  
  195. fp.BottomSurface=0
  196.  
  197. fp.Name=pn or "TBLib Part"
  198.  
  199. fp.Locked = true
  200.  
  201. fp.TopSurface=0
  202.  
  203. fp.CFrame=cn(0,0,0)
  204.  
  205. fp:BreakJoints()
  206.  
  207. fp.Anchored = a
  208.  
  209. return fp
  210.  
  211. end
  212.  
  213.  
  214.  
  215. function ClearClass(Object,Class)
  216.  
  217. for _,v in pairs(Object:GetChildren()) do
  218.  
  219. if v:IsA(Class) then
  220.  
  221. v:Destroy()
  222.  
  223. end
  224.  
  225. end
  226.  
  227. end
  228.  
  229.  
  230.  
  231. function GetClass(Object,Class)
  232.  
  233. for _,v in pairs(Object:GetChildren()) do
  234.  
  235. if v:IsA(Class) then
  236.  
  237. return v
  238.  
  239. end
  240.  
  241. end
  242.  
  243. end
  244.  
  245.  
  246.  
  247. function re(par,obj)
  248.  
  249. if par:findFirstChild(obj) then
  250.  
  251. par[obj]:Remove''
  252.  
  253. end
  254.  
  255. end
  256.  
  257.  
  258.  
  259. function invis(o)
  260.  
  261. for i,v in pairs(o:children()) do
  262.  
  263. if v:IsA("BasePart") then
  264.  
  265. v.Transparency=1
  266.  
  267. end
  268.  
  269. invis(v)
  270.  
  271. end
  272.  
  273. end
  274.  
  275.  
  276.  
  277. function newhats(p,o,o2)
  278.  
  279. for i,v in pairs(p:children()) do
  280.  
  281. if v:IsA("Hat") then
  282.  
  283. local np=v.Handle:Clone''
  284.  
  285. np.Transparency=0
  286.  
  287. np.Mesh.Scale=np.Mesh.Scale*1.04
  288.  
  289. np.Parent=o
  290.  
  291. np.CFrame=v.Handle.CFrame
  292.  
  293. np.Name="Hat"
  294.  
  295. stick2(np,o2,o)
  296.  
  297. end
  298.  
  299. end
  300.  
  301. end
  302.  
  303.  
  304.  
  305. fade = function(prt,incr)
  306.  
  307. q(function()
  308.  
  309. for i=prt.Transparency,1,incr do
  310.  
  311. prt.Transparency=i
  312.  
  313. wait()
  314.  
  315. end
  316.  
  317. prt:Remove''
  318.  
  319. end)
  320.  
  321. end
  322.  
  323.  
  324.  
  325. function weld(pa,p0,p1,x,y,z,a,b,c)
  326.  
  327. local fw=it("Weld",pa)
  328.  
  329. fw.Part0=p0
  330.  
  331. fw.Part1=p1
  332.  
  333. fw.C0=cn(x,y,z)*ca(a,b,c)
  334.  
  335. return fw
  336.  
  337. end
  338.  
  339.  
  340.  
  341.  
  342.  
  343. stick = function(hit2,hit)
  344.  
  345. return qi({"Weld",hit2,Part0=hit2,Part1=hit,C0=hit2.CFrame:inverse()*cn(hit2.Position),C1=hit.CFrame:inverse()*cn(hit2.Position)})
  346.  
  347. end
  348.  
  349.  
  350.  
  351. function stick2(hit2,hit,tostick)
  352.  
  353. local weld=it("Weld")
  354.  
  355. weld.Part0=tostick
  356.  
  357. weld.Part1=hit2
  358.  
  359. local HitPos=hit.Position
  360.  
  361. local CJ=cn(HitPos)
  362.  
  363. local C0=hit2.CFrame:inverse() *CJ
  364.  
  365. local C1=hit.CFrame:inverse() * CJ weld.C0=C1
  366.  
  367. weld.C1=C0
  368.  
  369. weld.Parent=hit2
  370.  
  371. end
  372.  
  373.  
  374.  
  375. ray = function(Pos, Dir,tab)
  376.  
  377. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit *999),tab)
  378.  
  379. end
  380.  
  381.  
  382.  
  383. function rtab(tabz,obj)
  384.  
  385. for i=1,#tabz do
  386.  
  387. if tabz[i] == obj then
  388.  
  389. tr(tabz,i)
  390.  
  391. break
  392.  
  393. end
  394.  
  395. end
  396.  
  397. end
  398.  
  399.  
  400.  
  401. sTrail={}
  402.  
  403. function Trail2(lopz,ob,waitz,col,thickz,ofz) cw(function() ti(sTrail,ob)
  404.  
  405. local oldpos=(ob.CFrame *ofz).p local lopz2=0
  406.  
  407. local function loltr() local obp=(ob.CFrame *ofz).p lopz2=lopz2 + 1
  408.  
  409. local mag=(oldpos - obp).magnitude
  410.  
  411. local tr=pa(ob,"trail","Block",0,0,0,false,false,0.5,0.15,col) tr.Anchored=true
  412.  
  413. tr.CFrame=cn(oldpos,obp)
  414.  
  415. tr.CFrame=tr.CFrame + tr.CFrame.lookVector* (mag/2)
  416.  
  417. local trm=it("CylinderMesh",tr) trm.Scale=v3(5*thickz,mag*5,5*thickz)
  418.  
  419. cw(function() for i=5*thickz,0,-5*thickz/10 do trm.Scale=v3(i,mag*5,i) w() end tr:Remove'' end)
  420.  
  421. tr.CFrame=tr.CFrame *ca(rd(90),0,0) oldpos=obp end
  422.  
  423. repeat loltr()
  424.  
  425. wait(waitz) until ft(sTrail,ob) == nil or lopz2 == lopz loltr() end) end
  426.  
  427.  
  428.  
  429. Trail = function(ob,times,waitz,col,thickz,ofz) -- Brick Trail
  430.  
  431. q(function()
  432.  
  433. local oldpos=(ob.CFrame *ofz).p
  434.  
  435. for i=1,times do
  436.  
  437. if effon==true then
  438.  
  439. local obp=(ob.CFrame *ofz).p
  440.  
  441. local mag=(oldpos - obp).magnitude
  442.  
  443. local tr=pa(ob,"trail","Block",0,0,0,false,false,0.5,0.15,col)
  444.  
  445. tr.Anchored=true
  446.  
  447. tr.CFrame=cn(oldpos,obp)
  448.  
  449. tr.CFrame=tr.CFrame + tr.CFrame.lookVector* (mag/2)
  450.  
  451. trm=it("CylinderMesh",tr)
  452.  
  453. trm.Scale=v3(thickz,mag*5,thickz)
  454.  
  455. q(function()
  456.  
  457. for i=thickz,0,thickz/10 do
  458.  
  459. trm.Scale=v3(i,mag*5,i)
  460.  
  461. wait()
  462.  
  463. end
  464.  
  465. tr:Remove''
  466.  
  467. end)
  468.  
  469. tr.CFrame=tr.CFrame *ca(rd(90),0,0)
  470.  
  471. oldpos=obp wait(waitz)
  472.  
  473. end
  474.  
  475. end
  476.  
  477. end)
  478.  
  479. end
  480.  
  481.  
  482.  
  483. de = function(it,ti) game:service'Debris':AddItem(it,ti) end -- Debris
  484.  
  485.  
  486.  
  487. GlowMesh = function(anch,meshid2,rootz,mv3,colzz,adjus,l1,l2,l3) q(function() -- Glowmesh
  488.  
  489. 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
  490.  
  491. 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
  492.  
  493. for i=l1,l2,l3 do spi.Transparency=i spim.Scale=mv3*(i+0.3) wait() end spi:Remove'' end)
  494.  
  495. end
  496.  
  497.  
  498.  
  499. DetectSurface = function(pos, part) -- Surface Detector
  500.  
  501. local surface = nil local pospos = part.CFrame
  502.  
  503. local pos2 = pospos:pointToObjectSpace(pos) local siz = part.Size local shaep = part.Shape
  504.  
  505. if shaep == Enum.PartType.Ball or shaep == Enum.PartType.Cylinder then
  506.  
  507. surface = {"Anything", cn(pospos.p, pos)*cn(0, 0, -(pospos.p - pos).magnitude+0.12)*ca(rd(-90), 0, 0)}
  508.  
  509. else if pos2.Y > ((siz.Y/2)-0.01) then surface = {"Top", ca(0, 0, 0)}
  510.  
  511. 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))}
  512.  
  513. 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
  514.  
  515.  
  516.  
  517. BulletHole = function(HitPos,HitObj,sc,img,par) -- Bullethole function
  518.  
  519. local Surface = DetectSurface(HitPos, HitObj)
  520.  
  521. local C = cn(HitPos) * ca(HitObj.CFrame:toEulerAnglesXYZ()) * Surface[2]
  522.  
  523. if Surface[1] == "Anything" then C = Surface[2] end local theimg = img or ds.BulletHole
  524.  
  525. local bl = pa(workspace or par,"bullethole","Block",sc,0,sc,false,true,1,0,"") qi({"Decal",bl,Face="Top",Texture=theimg})
  526.  
  527. 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)
  528.  
  529. end
  530.  
  531.  
  532.  
  533. so = function(id,par,vol,pit) q(function() -- Sound maker
  534.  
  535. local sou = qi({"Sound",par or workspace,Volume=vol,Pitch=pit or 1,SoundId=id})
  536.  
  537. wait() sou:play() wait(6) sou:Remove() end) end
  538.  
  539.  
  540.  
  541. -- local/so(asset..ds.GothicMusic,workspace,1,2.6)
  542.  
  543.  
  544.  
  545. function GetRegion(p0,p1,f,f2) q(function()
  546.  
  547. 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
  548.  
  549. end) end
  550.  
  551.  
  552.  
  553. FindGround = function(pos) -- ground finder
  554.  
  555. local ax,ay,az = pos:toEulerAnglesXYZ()
  556.  
  557. local bhit,bpos=ray(pos.p,pos.p - (pos.p + v3(0,200,0)))
  558.  
  559. if bhit and bpos then
  560.  
  561. return cn(bpos)*ca(ax,ay,az)
  562.  
  563. end
  564.  
  565. return nil
  566.  
  567. end
  568.  
  569.  
  570.  
  571. function NPC(Name, Position) -- npc maker
  572.  
  573. local Character = Instance.new("Model")
  574.  
  575. Character.Name = Name
  576.  
  577. local Humanoid = Instance.new("Humanoid")
  578.  
  579. Humanoid.Parent = Character
  580.  
  581. local Template = Instance.new("Part")
  582.  
  583. Template.FormFactor = "Custom"
  584.  
  585. Template.Size = Vector3.new(1, 2, 1)
  586.  
  587. Template.Locked = true
  588.  
  589. local Head = Template:Clone()
  590.  
  591. Head.Name = "Head"
  592.  
  593. Head.TopSurface = "Smooth"
  594.  
  595. Head.BottomSurface = "Smooth"
  596.  
  597. Head.Size = Vector3.new(2, 1, 1)
  598.  
  599. Head.Parent = Character
  600.  
  601. local Mesh = Instance.new("SpecialMesh")
  602.  
  603. Mesh.MeshType = "Head"
  604.  
  605. Mesh.Scale = Vector3.new(1.25, 1.25, 1.25)
  606.  
  607. Mesh.Parent = Head
  608.  
  609. local Face = Instance.new("Decal")
  610.  
  611. Face.Name = "face"
  612.  
  613. Face.Texture = "rbxasset://textures/face.png"
  614.  
  615. Face.Parent = Head
  616.  
  617. local Torso = Template:Clone()
  618.  
  619. Torso.Name = "Torso"
  620.  
  621. Torso.LeftSurface = "Weld"
  622.  
  623. Torso.RightSurface = "Weld"
  624.  
  625. Torso.CFrame = CFrame.new(0, 10000, 0)
  626.  
  627. Torso.Size = Vector3.new(2, 2, 1)
  628.  
  629. Torso.Parent = Character
  630.  
  631. local TShirt = Instance.new("Decal")
  632.  
  633. TShirt.Name = "roblox"
  634.  
  635. TShirt.Parent = Torso
  636.  
  637. local LeftArm = Template:Clone()
  638.  
  639. LeftArm.Name = "Left Arm"
  640.  
  641. LeftArm.Parent = Character
  642.  
  643. local RightArm = Template:Clone()
  644.  
  645. RightArm.Name = "Right Arm"
  646.  
  647. RightArm.Parent = Character
  648.  
  649. local LeftLeg = Template:Clone()
  650.  
  651. LeftLeg.Name = "Left Leg"
  652.  
  653. LeftLeg.Parent = Character
  654.  
  655. local RightLeg = Template:Clone()
  656.  
  657. RightLeg.Name = "Right Leg"
  658.  
  659. RightLeg.Parent = Character
  660.  
  661. Character:BreakJoints()
  662.  
  663. local Neck = Instance.new("Weld")
  664.  
  665. Neck.Name = "Neck"
  666.  
  667. Neck.Part0 = Torso
  668.  
  669. Neck.Part1 = Head
  670.  
  671. Neck.C0 = CFrame.new(0, 1.5, 0)
  672.  
  673. Neck.Parent = Torso
  674.  
  675. local LeftShoulder = Instance.new("Motor")
  676.  
  677. LeftShoulder.Name = "Left Shoulder"
  678.  
  679. LeftShoulder.Part0 = Torso
  680.  
  681. LeftShoulder.Part1 = LeftArm
  682.  
  683. LeftShoulder.MaxVelocity = 0.1
  684.  
  685. LeftShoulder.C0 = CFrame.new(-Torso.Size.x / 2 - RightArm.Size.x / 2, LeftArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, -math.pi / 2, 0)
  686.  
  687. LeftShoulder.C1 = CFrame.new(0, LeftArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, -math.pi / 2, 0)
  688.  
  689. LeftShoulder.Parent = Torso
  690.  
  691. local RightShoulder = Instance.new("Motor")
  692.  
  693. RightShoulder.Name = "Right Shoulder"
  694.  
  695. RightShoulder.Part0 = Torso
  696.  
  697. RightShoulder.Part1 = RightArm
  698.  
  699. RightShoulder.MaxVelocity = 0.1
  700.  
  701. RightShoulder.C0 = CFrame.new(Torso.Size.x / 2 + RightArm.Size.x / 2, RightArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
  702.  
  703. RightShoulder.C1 = CFrame.new(0, RightArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
  704.  
  705. RightShoulder.Parent = Torso
  706.  
  707. local LeftHip = Instance.new("Motor")
  708.  
  709. LeftHip.Name = "Left Hip"
  710.  
  711. LeftHip.Part0 = Torso
  712.  
  713. LeftHip.Part1 = LeftLeg
  714.  
  715. LeftHip.MaxVelocity = 0.1
  716.  
  717. LeftHip.C0 = CFrame.new(-LeftLeg.Size.x / 2, -LeftLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, -math.pi / 2, 0)
  718.  
  719. LeftHip.C1 = CFrame.new(0, LeftLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, -math.pi / 2, 0)
  720.  
  721. LeftHip.Parent = Torso
  722.  
  723. local RightHip = Instance.new("Motor")
  724.  
  725. RightHip.Name = "Right Hip"
  726.  
  727. RightHip.Part0 = Torso
  728.  
  729. RightHip.Part1 = RightLeg
  730.  
  731. RightHip.MaxVelocity = 0.1
  732.  
  733. RightHip.C0 = CFrame.new(RightLeg.Size.x / 2, -RightLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
  734.  
  735. RightHip.C1 = CFrame.new(0, RightLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, math.pi / 2, 0)
  736.  
  737. RightHip.Parent = Torso
  738.  
  739. local BodyColors = Instance.new("BodyColors")
  740.  
  741. BodyColors.LeftArmColor = BrickColor.new("Bright yellow")
  742.  
  743. BodyColors.RightArmColor = BrickColor.new("Bright yellow")
  744.  
  745. BodyColors.LeftLegColor = BrickColor.new("Br. yellowish green")
  746.  
  747. BodyColors.RightLegColor = BrickColor.new("Br. yellowish green")
  748.  
  749. BodyColors.HeadColor = BrickColor.new("Bright yellow")
  750.  
  751. BodyColors.TorsoColor = BrickColor.new("Bright blue")
  752.  
  753. BodyColors.Parent = Character
  754.  
  755. Character.Parent = Workspace
  756.  
  757. Character:MoveTo(Position)
  758.  
  759. Character:MoveTo(Torso.Position + Vector3.new(0, 3, 0))
  760.  
  761. return Character
  762.  
  763. end
  764.  
  765.  
  766.  
  767. AddBV=function(str,cfr,par,debt)
  768.  
  769. if not par then return end
  770.  
  771. if par:findFirstChild'LibBV' then par.LibBV:Remove() end
  772.  
  773. tbbodyvelocity=qi{'BodyVelocity',par,velocity=cfr.lookVector*str,maxForce=v3(1/0,1/0,1/0),Name='LibBV'} deb:AddItem(tbbodyvelocity,debt)
  774.  
  775. end
  776.  
  777.  
  778.  
  779. AddBG=function(str,par,debt)
  780.  
  781. if not par then return end
  782.  
  783. if par:findFirstChild'LibBG' then par.LibBG:Remove() end
  784.  
  785. tbbodygyro=qi{'BodyGyro',par,maxTorque=v3(1/0,1/0,1/0),P=100000,cframe=str,Name='LibBG'} deb:AddItem(tbbodygyro,debt)
  786.  
  787. end
  788.  
  789.  
  790.  
  791. AddBAV=function(vec3,par,debt)
  792.  
  793. if not par then return end
  794.  
  795. if par:findFirstChild'LibBAV' then par.LibBAV:Remove() end
  796.  
  797. tbbodyangularvelocity=qi{'BodyAngularVelocity',par,maxTorque=v3(1/0,1/0,1/0),angularvelocity=vec3,Name='LibBAV'} deb:AddItem(tbbodyangularvelocity,debt)
  798.  
  799. end
  800.  
  801.  
  802.  
  803. Dmg = function(Hum,Dealt,Critical)
  804.  
  805. local HM=Hum.Parent
  806.  
  807. local HMT,HMB=HM:findFirstChild'Torso',HM:findFirstChild'Block'
  808.  
  809. local Blocks=HMB and HMB.Value>0
  810.  
  811. if HMT then
  812.  
  813. local mm=qi{'Model',HMT} qi{'Humanoid',mm,MaxHealth=0} deb:AddItem(mm,1)
  814.  
  815. 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}
  816.  
  817. if Blocks then
  818.  
  819. mm.Name='Block!'
  820.  
  821. mp.BrickColor=bn'Bright blue'
  822.  
  823. HMB.Value=HMB.Value-1
  824.  
  825. elseif not Blocks then
  826.  
  827. mm.Name=Dealt
  828.  
  829. mp.BrickColor=bn'Bright red'
  830.  
  831. end
  832.  
  833. end
  834.  
  835. if not Blocks then
  836.  
  837. Hum:TakeDamage(Dealt)
  838.  
  839. end
  840.  
  841. end
  842.  
  843.  
  844.  
  845. GetHum = function(part)
  846.  
  847. local Hum,HT,block
  848.  
  849. for i,v in pairs(part.Parent:children()) do
  850.  
  851. if v:IsA("Humanoid") then
  852.  
  853. Hum=v
  854.  
  855. elseif v.Name=='Torso' then
  856.  
  857. HT=v
  858.  
  859. elseif v.Name=='Block' and v:IsA("NumberValue") then
  860.  
  861. block=v
  862.  
  863. end
  864.  
  865. end
  866.  
  867. return Hum,HT,block
  868.  
  869. end
  870.  
  871.  
  872.  
  873. Lightning = function(p0,p1,tym,ofs,col,th,tra) -- start end times offset color thickness
  874.  
  875. local magz = (p0 - p1).magnitude local curpos = p0 local trz = {-ofs,ofs}
  876.  
  877. for i=1,tym do
  878.  
  879. local li = it("Part",c) li.TopSurface =0 li.BottomSurface = 0 li.Anchored = true li.Transparency = tra or 0.4 li.BrickColor = bc(col)
  880.  
  881. 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)])
  882.  
  883. local trolpos = cn(curpos,p1)*cn(0,0,magz/tym).p+ofz
  884.  
  885. if tym == i then
  886.  
  887. local magz2 = (curpos - p1).magnitude li.Size = v3(th,th,magz2)
  888.  
  889. li.CFrame = cn(curpos,p1)*cn(0,0,-magz2/2)
  890.  
  891. else
  892.  
  893. li.CFrame = cn(curpos,trolpos)*cn(0,0,magz/tym/2)
  894.  
  895. end
  896.  
  897. curpos = li.CFrame*cn(0,0,magz/tym/2).p de(li,0.25)
  898.  
  899. end
  900.  
  901. end
  902.  
  903.  
  904.  
  905. MakeCrater = function(pos,sc,tyms,debz,par) -- crater maker
  906.  
  907. q(function()
  908.  
  909. if not debz then
  910.  
  911. debz = 5
  912.  
  913. end
  914.  
  915. local bhit,bpos=ray(pos,pos - (pos + v3(0,200,0)))
  916.  
  917. if bhit and bpos then
  918.  
  919. for i=1,tyms do
  920.  
  921. q(function()
  922.  
  923. 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)
  924.  
  925. gr.Material = bhit.Material
  926.  
  927. gr.TopSurface = bhit.TopSurface
  928.  
  929. 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)))
  930.  
  931. wait(debz)
  932.  
  933. fade(gr,0.1)
  934.  
  935. end)
  936.  
  937. end
  938.  
  939. end
  940.  
  941. end)
  942.  
  943. end
  944.  
  945.  
  946.  
  947. MakeCrack = function(pos,sc,debz,par) -- crackmaker
  948.  
  949. q(function()
  950.  
  951. if not debz then
  952.  
  953. debz = 5
  954.  
  955. end
  956.  
  957. local bhit,bpos=ray(pos,pos - (pos + v3(0,10,0)))
  958.  
  959. if bhit and bpos then
  960.  
  961. local cr = pa(par or workspace,"Crack","Block",sc,0,sc,false,true,1,0,"") cr.CFrame = cn(bpos)
  962.  
  963. local dec=qi({"Decal",cr,Face="Top",Texture=ds.Crack}) de(cr,debz)
  964.  
  965. end
  966.  
  967. end)
  968.  
  969. end
  970.  
  971.  
  972.  
  973. a = {}
  974.  
  975. a.insw={}
  976.  
  977. function cleanweld(wexx,namzi)
  978.  
  979. local tn=ft2(a.insw,wexx)
  980.  
  981. if tn==nil then return end
  982.  
  983. if namzi=="p0" then
  984.  
  985. a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]=0,0,0 elseif namzi=="p1" then
  986.  
  987. a.insw[tn][2]["p1x"],a.insw[tn][2]["p1y"],a.insw[tn][2]["p1z"]=0,0,0 elseif namzi=="a0" then
  988.  
  989. a.insw[tn][2]["a0x"],a.insw[tn][2]["a0y"],a.insw[tn][2]["a0z"]=0,0,0 elseif namzi=="a1" then
  990.  
  991. a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]=0,0,0
  992.  
  993. end
  994.  
  995. end
  996.  
  997. function c2(wexx,smmx,c0orc1,aa,bb,cc,xx,yy,zz)
  998.  
  999. q(function()
  1000.  
  1001. c1(wexx,smmx,c0orc1,aa,bb,cc,xx,yy,zz)
  1002.  
  1003. end)
  1004.  
  1005. end
  1006.  
  1007. a.Welding=0
  1008.  
  1009. function c1(wexx,smmx,c0orc1,aa,bb,cc,xx,yy,zz)
  1010.  
  1011. if ft2(a.insw,wexx)==nil then
  1012.  
  1013. ti(a.insw,{wexx,{}})
  1014.  
  1015. local tn=ft2(a.insw,wexx)
  1016.  
  1017. a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]=wexx.C0.x,wexx.C0.y,wexx.C0.z
  1018.  
  1019. a.insw[tn][2]["p1x"],a.insw[tn][2]["p1y"],a.insw[tn][2]["p1z"]=wexx.C1.x,wexx.C1.y,wexx.C1.z
  1020.  
  1021. a.insw[tn][2]["a0x"],a.insw[tn][2]["a0y"],a.insw[tn][2]["a0z"]=wexx.C0:toEulerAnglesXYZ()
  1022.  
  1023. a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]=wexx.C1:toEulerAnglesXYZ()
  1024.  
  1025. end
  1026.  
  1027. local tn=ft2(a.insw,wexx)
  1028.  
  1029. local xx2,yy2,zz2=0,0,0
  1030.  
  1031. local x2,y2,z2=0,0,0
  1032.  
  1033. if c0orc1==0 then
  1034.  
  1035. xx2,yy2,zz2=a.insw[tn][2]["a0x"],a.insw[tn][2]["a0y"],a.insw[tn][2]["a0z"]
  1036.  
  1037. x2,y2,z2=a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]
  1038.  
  1039. elseif c0orc1==1 then
  1040.  
  1041. xx2,yy2,zz2=a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]
  1042.  
  1043. x2,y2,z2=a.insw[tn][2]["p1x"],a.insw[tn][2]["p1y"],a.insw[tn][2]["p1z"]
  1044.  
  1045. else
  1046.  
  1047. xx2,yy2,zz2=a.insw[tn][2]["a1x"],a.insw[tn][2]["a1y"],a.insw[tn][2]["a1z"]
  1048.  
  1049. x2,y2,z2=a.insw[tn][2]["p0x"],a.insw[tn][2]["p0y"],a.insw[tn][2]["p0z"]
  1050.  
  1051. end a.Welding=a.Welding + 1
  1052.  
  1053. local twa=1
  1054.  
  1055. if smmx >= 1 then
  1056.  
  1057. else
  1058.  
  1059. for i=smmx,0.8,smmx do
  1060.  
  1061. twa = 1
  1062.  
  1063. if c0orc1==0 then
  1064.  
  1065. 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))
  1066.  
  1067. elseif c0orc1==1 then
  1068.  
  1069. 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))
  1070.  
  1071. else local x,y,z = wexx.C0:toEulerAnglesXYZ()
  1072.  
  1073. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i))*ca(x,y,z)
  1074.  
  1075. 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))
  1076.  
  1077. end
  1078.  
  1079. if fu then
  1080.  
  1081. q(fu)
  1082.  
  1083. end
  1084.  
  1085. wait()
  1086.  
  1087. end
  1088.  
  1089. for i=0.8,1,smmx*0.45 do
  1090.  
  1091. twa = 1
  1092.  
  1093. if c0orc1==0 then
  1094.  
  1095. 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))
  1096.  
  1097. elseif c0orc1==1 then
  1098.  
  1099. 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))
  1100.  
  1101. else local x,y,z = wexx.C0:toEulerAnglesXYZ()
  1102.  
  1103. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i))*ca(x,y,z)
  1104.  
  1105. 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))
  1106.  
  1107. end
  1108.  
  1109. wait()
  1110.  
  1111. end
  1112.  
  1113. end
  1114.  
  1115. local i=1
  1116.  
  1117. if c0orc1==0 then
  1118.  
  1119. 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))
  1120.  
  1121. elseif c0orc1==1 then
  1122.  
  1123. 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))
  1124.  
  1125. else local x,y,z = wexx.C0:toEulerAnglesXYZ()
  1126.  
  1127. wexx.C0=cn(x2-(((x2-aa)/twa)*i),y2-(((y2-bb)/twa)*i),z2-(((z2-cc)/twa)*i))*ca(x,y,z)
  1128.  
  1129. 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))
  1130.  
  1131. end
  1132.  
  1133. a.Welding=a.Welding - 1
  1134.  
  1135. local tn=ft2(a.insw,wexx)
  1136.  
  1137. if c0orc1==0 then
  1138.  
  1139. 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)
  1140.  
  1141. 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)
  1142.  
  1143. elseif c0orc1==1 then
  1144.  
  1145. 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)
  1146.  
  1147. 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)
  1148.  
  1149. elseif c0orc1==3 then
  1150.  
  1151. local x,y,z=wexx.C0.x,wexx.C0.y,wexx.C0.z
  1152.  
  1153. 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)
  1154.  
  1155. local x,y,z=wexx.C1:toEulerAnglesXYZ()
  1156.  
  1157. 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)
  1158.  
  1159. end
  1160.  
  1161. end
  1162.  
  1163.  
  1164.  
  1165. Welds={}
  1166.  
  1167. Ani=function(w,a,b,c,d,e,f,ty,inc,sined)
  1168.  
  1169. if not Welds[w] then
  1170.  
  1171. local d0,e0,f0=w.C0:toEulerAnglesXYZ() local d1,e1,f1=w.C1:toEulerAnglesXYZ()
  1172.  
  1173. local d0,e0,f0=mdeg(d0),mdeg(e0),mdeg(f0) local d1,e1,f1=mdeg(d1),mdeg(e1),mdeg(f1)
  1174.  
  1175. 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}}
  1176.  
  1177. end
  1178.  
  1179. local c0,c1=Welds[w][0],Welds[w][1]
  1180.  
  1181. c0[1],c0[2],c0[3]=w.C0.x,w.C0.y,w.C0.z
  1182.  
  1183. c1[1],c1[2],c1[3]=w.C1.x,w.C1.y,w.C1.z
  1184.  
  1185. local A0,B0,C0,D0,E0,F0 = unpack(c0)
  1186.  
  1187. local A1,B1,C1,D1,E1,F1 = unpack(c1)
  1188.  
  1189. local Do = function(i)
  1190.  
  1191. if ty==0 then
  1192.  
  1193. 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) )
  1194.  
  1195. elseif ty==1 then
  1196.  
  1197. 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) )
  1198.  
  1199. else
  1200.  
  1201. w.C0=cn( A0-((A0-a)*i) , B0-((B0-b)*i) , C0-((C0-c)*i) ) * ca2(D0,E0,F0)
  1202.  
  1203. w.C1=cn(A1,B1,C1) * ca2( D1-((D1-d)*i) , E1-(((E1-e)/1)*i) , F1-((F1-f)*i) )
  1204.  
  1205. end
  1206.  
  1207. end
  1208.  
  1209. for i=inc,1,inc do
  1210.  
  1211. Do(sined and math.sin(math.pi/2*i) or i)
  1212.  
  1213. wait()
  1214.  
  1215. end
  1216.  
  1217. Do(1)
  1218.  
  1219. if ty==0 then
  1220.  
  1221. c0[4],c0[5],c0[6]=d,e,f
  1222.  
  1223. else
  1224.  
  1225. c1[4],c1[5],c1[6]=d,e,f
  1226.  
  1227. end
  1228.  
  1229. end
  1230.  
  1231. 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
  1232.  
  1233. rAni=function(w)
  1234.  
  1235. Welds[w]=nil
  1236.  
  1237. end
  1238.  
  1239.  
  1240.  
  1241. gunshot = function(speed,sc,dmg,cff) q(function() -- gunshot function
  1242.  
  1243. local bb = pa(workspace,"bullet","Block",0.2*sc,0.3*sc,0.2*sc,true,true,0,0.1,"Black") qi({"CylinderMesh",bb})
  1244.  
  1245. bb.CFrame = cff*ca(rd(rn(-1000,1000)/1500),rd(rn(-1000,1000)/1500),rd(rn(-1000,1000)/1500))
  1246.  
  1247. so(ds.Fire,bb,0.3,1) wait() for i=1,50 do
  1248.  
  1249. bhit,bpos=ray(bb.Position,bb.Position - (bb.CFrame *cn(0,-1,0)).p)
  1250.  
  1251. if bhit and bhit.Name ~= "bullet" and bhit.Name ~= "bullethole" and bpos and (bpos - bb.Position).magnitude < speed then break end
  1252.  
  1253. bb.CFrame=bb.CFrame*cn(0,speed,0)*ca(rd(-0.2),0,0)
  1254.  
  1255. wait()
  1256.  
  1257. end bb.CFrame=bb.CFrame*cn(0,(bpos-bb.Position).magnitude,0)
  1258.  
  1259. if not bhit.Anchored then
  1260.  
  1261. if bhit.Parent:findFirstChild("Humanoid") then local h = bhit.Parent.Humanoid h.Health=h.Health-dmg so(ds.Hit,bhit,0.3,1) end
  1262.  
  1263. else if bhit.Name~="Base" then bhit.Anchored=false bhit:BreakJoints() end end bb:Remove()
  1264.  
  1265. if bhit.Parent:findFirstChild("Humanoid") == nil then BulletHole(bpos,bhit,0.7*sc) end
  1266.  
  1267. end) end
  1268.  
  1269.  
  1270.  
  1271. dive = function(ob2,pro,ite,stof)
  1272.  
  1273. local function div(ob) for i,v in pairs(ob:children()) do if v[pro] == ite then
  1274.  
  1275. for i=1,#stof do v[stof[i][1]] = stof[i][2] end else div(v) end end end
  1276.  
  1277. div(ob2)
  1278.  
  1279. end
  1280.  
  1281.  
  1282.  
  1283. fc = function(ob,cl)
  1284.  
  1285. for i,v in pairs(ob:children()) do if v.className:lower()==cl:lower() then return v end end
  1286.  
  1287. end
  1288.  
  1289.  
  1290.  
  1291. function se(Key,Text)
  1292.  
  1293. local Values = {}
  1294.  
  1295. for value in (Text..Key):gmatch("(.-)"..Key) do
  1296.  
  1297. table.insert(Values,value)
  1298.  
  1299. end return Values
  1300.  
  1301. end
  1302.  
  1303.  
  1304.  
  1305. local thefenv = getfenv()
  1306.  
  1307. getfenv()["rmhelp"] = function()
  1308.  
  1309. local nus = 0
  1310.  
  1311. for i,v in pairs(thefenv) do if i ~= "wait" and i ~= "script" then nus = nus + 1 wait(0.05)
  1312.  
  1313. print(string.rep(" ",3-#tostring(nus)) ..nus.. ") " ..i.. " (" ..type(v).. ")")
  1314.  
  1315. end
  1316.  
  1317. end
  1318.  
  1319. end
  1320.  
  1321.  
  1322.  
  1323. for i,v in pairs(thefenv) do
  1324.  
  1325. _G[i] = v
  1326.  
  1327. --print(i)
  1328.  
  1329. end
  1330.  
  1331.  
  1332.  
  1333. _G[" r".."m".."d".."x "] = [[
  1334.  
  1335. for i,v in pairs(_G) do
  1336.  
  1337. if i ~= "wait" and i ~= "script" then
  1338.  
  1339. getfenv()[i] = v
  1340.  
  1341. end
  1342.  
  1343. end
  1344.  
  1345. ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement