Advertisement
FloweyTheFlower

Roblox Scripts #30 Noob + Tec Gun + Knife + Ghost

Sep 4th, 2017
1,041
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 64.44 KB | None | 0 0
  1. wait(.2)
  2. local toool = Instance.new("Tool",game.Players.LocalPlayer.Backpack)
  3. toool.Name = "QuickScope"
  4.  
  5. local hndle = Instance.new("Part",toool)
  6. hndle.Name = "Handle"
  7.  
  8. local mesh = Instance.new("SpecialMesh",hndle)
  9. mesh.MeshId = "http://www.roblox.com/asset/?id=121944778"
  10. mesh.TextureId = "http://www.roblox.com/asset/?id=556650177"
  11. mesh.Scale = Vector3.new(.7,.7,.7)
  12.  
  13. local sound = Instance.new("Sound",hndle)
  14.  
  15.  
  16. script.Parent = toool
  17.  
  18.  
  19.  
  20.  
  21. local tool=script.Parent
  22.  
  23. local player=game.Players.LocalPlayer
  24.  
  25. local char=player.Character
  26.  
  27. local humanoid=char:FindFirstChild("Humanoid")
  28.  
  29. local camera=workspace.CurrentCamera
  30.  
  31. local rightC1 = CFrame.new(-0.5, 0.7, 0) * CFrame.Angles(0, (math.pi / 2), 0)
  32.  
  33. local leftC1 = CFrame.new(0, 0.7, 0) * CFrame.Angles(0, (math.pi / 2), 0)
  34.  
  35. local mouse=player:GetMouse()
  36.  
  37. local equipping=false
  38.  
  39. local gettingknife=false
  40.  
  41. local laserCharge=false
  42.  
  43. local playcharge=false
  44.  
  45. local justthrown=false
  46.  
  47. local canLaser=true
  48.  
  49. local justattacked=false
  50.  
  51. local thrownkniferotation=0
  52.  
  53. local Damage=500
  54.  
  55. local Attacking=false
  56.  
  57. local handle=nil
  58.  
  59. local WalkSpeeds={16,22}
  60.  
  61. local fasterthrow = .4
  62.  
  63. local knifespeed = 450
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71. --[[if player.Gamepass4.Value == true then
  72.  
  73. fasterthrow = 0.5
  74.  
  75. else
  76.  
  77. fasterthrow = 0.2
  78.  
  79. end
  80.  
  81. if player.Gamepass5.Value == true then
  82.  
  83. knifespeed = 305
  84.  
  85. else
  86.  
  87. knifespeed = 225
  88.  
  89. end
  90. --]]
  91.  
  92.  
  93.  
  94.  
  95.  
  96. SOUNDS={
  97.  
  98. throwing={"153647554","153647549"},
  99.  
  100. laserthrowing={"193444173"},
  101.  
  102. shouts={"241084057","224360245","199837759","168209314"},
  103.  
  104. striking={"153647529","153647534","153647539","153647540"},
  105.  
  106. equip="153647514",
  107.  
  108. wallhit={"153647563","153647564"},
  109.  
  110. hitplayer={"153676325"},
  111.  
  112. deaths={"241084057","146457047","146594648","168209314"},
  113.  
  114. }
  115.  
  116.  
  117.  
  118. SETTINGS={
  119.  
  120.  
  121. tool={
  122.  
  123. tool_size=Vector3.new(0.4, 3, 0.7),
  124.  
  125. tool_transparency=0,
  126.  
  127. tool_color=BrickColor.Black(),
  128.  
  129. default_tool_size=0.6,
  130.  
  131. },
  132.  
  133.  
  134. }
  135.  
  136.  
  137.  
  138. function DamageObject(hit)
  139.  
  140. local char=hit.Parent
  141.  
  142. if char and char~=player.Character and char.Name~="Arms_Model" and hit.Name~="Handle" then
  143.  
  144. local h=char:FindFirstChild("Humanoid")
  145.  
  146. if h and h.Health > 0 then
  147.  
  148.  
  149.  
  150. h:TakeDamage(Damage)
  151.  
  152. PlaySound("Hit1",char.Torso)
  153.  
  154. local explosion = Instance.new("Explosion")
  155.  
  156. explosion.ExplosionType = 'NoCraters'
  157.  
  158. explosion.Position = humanoid.Torso.CFrame.p
  159.  
  160. explosion.BlastPressure=0
  161.  
  162. explosion.Parent=workspace
  163.  
  164. if h.Health == 0 then
  165.  
  166. PlaySound("Hit2")
  167.  
  168. end
  169.  
  170. end
  171.  
  172. end
  173.  
  174. end
  175.  
  176.  
  177.  
  178. function PlaySound(name,ctorso)
  179.  
  180. if name=="Throw" then
  181.  
  182. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.throwing[math.random(1,#SOUNDS.throwing)]
  183.  
  184. tool.Handle.Sound:Play()
  185.  
  186. elseif name=="ThrowLaser" then
  187.  
  188. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.laserthrowing[math.random(1,#SOUNDS.laserthrowing)]
  189.  
  190. tool.Handle.Sound:Play()
  191.  
  192. elseif name=="Equip" then
  193.  
  194. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.equip
  195.  
  196. tool.Handle.Sound:Play()
  197.  
  198. elseif name=="Swing" then
  199.  
  200. tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.striking[math.random(1,#SOUNDS.striking)]
  201.  
  202. tool.Handle.Sound:Play()
  203.  
  204. elseif name=="Hit1" then
  205.  
  206. local NewSound=tool.Handle.Sound:clone()
  207.  
  208. NewSound.Parent=ctorso
  209.  
  210. NewSound.SoundId = "rbxassetid://" .. SOUNDS.hitplayer[math.random(1,#SOUNDS.hitplayer)]
  211.  
  212. NewSound:Play()
  213.  
  214. NewSound:Destroy()
  215.  
  216. --elseif name=="Hit2" then
  217.  
  218. --local NewSound=tool.Handle.Sound:clone()
  219.  
  220. --NewSound.Parent=ctorso
  221.  
  222. --NewSound.SoundId = "rbxassetid://" .. SOUNDS.deaths[math.random(1,#SOUNDS.deaths)]
  223.  
  224. --NewSound:Play()
  225.  
  226. -- NewSound:Destroy()
  227.  
  228. elseif name=="Laser" then
  229.  
  230. local NewSound=tool.Handle.Sound:Clone()
  231.  
  232. NewSound.Parent = ctorso
  233. NewSound.SoundId = "rbxassetid://" .. SOUNDS.shouts[math.random(1,#SOUNDS.shouts)]
  234.  
  235. NewSound:Play()
  236.  
  237.  
  238. end
  239.  
  240. end
  241.  
  242.  
  243.  
  244. function Throwtool(dPos)
  245.  
  246. if not tool.Handle then return end
  247.  
  248. local throwingHandle = tool.Handle:Clone()
  249.  
  250. game:GetService("Debris"):AddItem(throwingHandle, 5)
  251.  
  252. throwingHandle.Transparency=0
  253.  
  254. throwingHandle.Parent = workspace
  255.  
  256. if player.Character and player.Character.Humanoid then
  257.  
  258. throwingHandle.Velocity = (player.Character.Humanoid.TargetPoint - throwingHandle.CFrame.p).unit * knifespeed
  259.  
  260. if canLaser then
  261.  
  262. throwingHandle.Velocity = (player.Character.Humanoid.TargetPoint - throwingHandle.CFrame.p).unit * 15000
  263.  
  264. end
  265.  
  266. if mouse.Target ~= nil then
  267.  
  268. if mouse.Target.Parent.Name~="Arms_Model" and mouse.Target.Name~="ThrownKnife" and mouse.Target.Name~="Handle" then
  269.  
  270. targetpos=player.Character.Humanoid.TargetPoint
  271.  
  272. else
  273.  
  274. targetpos=Vector3.new(0,-10,0)
  275.  
  276. end
  277.  
  278. end
  279.  
  280. -- set the orientation to the direction it is being thrown in
  281.  
  282. throwingHandle.CFrame = CFrame.new(throwingHandle.CFrame.p, throwingHandle.CFrame.p + throwingHandle.Velocity) * CFrame.Angles(0, 0, math.rad(-90))
  283.  
  284. local floatingForce = Instance.new('BodyForce', throwingHandle)
  285.  
  286. floatingForce.force = Vector3.new(0, 196.2 * throwingHandle:GetMass() * 0.98, 0)
  287.  
  288. local spin = Instance.new('BodyAngularVelocity', throwingHandle)
  289.  
  290. spin.angularvelocity = throwingHandle.CFrame:vectorToWorldSpace(Vector3.new(0, -400, 0))
  291.  
  292. spawnPos=player.Character.PrimaryPart.Position
  293.  
  294. spawnPos = spawnPos + dPos*5
  295.  
  296. if canLaser then
  297.  
  298. local Ray = Ray.new(tool.Handle.CFrame.p,(mouse.Hit.p - tool.Handle.CFrame.p).unit * 999)
  299.  
  300. local Hit,Position = game.Workspace:FindPartOnRay(Ray,char)
  301.  
  302. if Hit then
  303.  
  304. if Hit.Parent:FindFirstChild("Humanoid") then
  305.  
  306. throwingHandle:Destroy()
  307.  
  308. Hit.Parent.Humanoid:TakeDamage(330)
  309. PlaySound("Laser",Hit.Parent.Torso)
  310. PlaySound("Hit1",Hit.Parent.Torso)
  311. laserCharge=true
  312.  
  313.  
  314.  
  315. local explosion = Instance.new("Explosion")
  316.  
  317. explosion.Position=Hit.Parent.Torso.Position
  318.  
  319. explosion.BlastRadius=explosion.BlastRadius*3
  320.  
  321. explosion.Parent=workspace
  322.  
  323. end end
  324.  
  325. local RayPart = Instance.new("Part",workspace)
  326.  
  327. RayPart.Name = "RayPart"
  328.  
  329. RayPart.BrickColor = BrickColor.new("Deep orange")
  330.  
  331. RayPart.Transparency = 0
  332.  
  333. RayPart.Anchored = true
  334.  
  335. RayPart.CanCollide = false
  336.  
  337. RayPart.TopSurface = Enum.SurfaceType.Smooth
  338.  
  339. RayPart.BottomSurface = Enum.SurfaceType.Smooth
  340.  
  341. RayPart.formFactor = Enum.FormFactor.Custom
  342.  
  343. local Distance = (Position-tool.Handle.CFrame.p).magnitude
  344.  
  345. RayPart.Size = Vector3.new(0.2,0.2,Distance)
  346.  
  347. RayPart.CFrame = CFrame.new(Position,tool.Handle.CFrame.p) * CFrame.new(0,0,-Distance/2)
  348.  
  349. game.Debris:addItem(RayPart,.5)
  350.  
  351.  
  352. end
  353.  
  354. end
  355.  
  356.  
  357. if throwingHandle then
  358.  
  359.  
  360.  
  361. local touchedConn = throwingHandle.Touched:connect(function(hit)
  362.  
  363. local char=hit.Parent
  364.  
  365. camera.CameraSubject=humanoid
  366.  
  367. camera.CameraType=Enum.CameraType.Custom
  368.  
  369. if char and char~=player.Character and char.Name~="Arms_Model" and hit.Name~="Handle" and hit.Name~="RayPart" then
  370.  
  371. local h=char:FindFirstChild("Humanoid")
  372.  
  373. if h and h.Health > 0 then
  374.  
  375. throwingHandle:Destroy()
  376.  
  377. laserCharge=true
  378.  
  379. if hit.Name~="Head" or hit.className=="Hat" then
  380.  
  381. h:TakeDamage(Damage)
  382.  
  383. -- player.Credits.Value = player.Credits.Value + 15
  384.  
  385. --player.PlayerGui.NormalKillGui.Script.Disabled = false
  386.  
  387. local explosion = Instance.new("Explosion")
  388.  
  389. explosion.Position=h.Parent.Torso.Position
  390.  
  391. explosion.BlastRadius=explosion.BlastRadius*2
  392.  
  393. explosion.Parent=workspace
  394.  
  395.  
  396. if h.Health == 0 then
  397.  
  398. PlaySound("Hit2",char.Torso)
  399.  
  400. end
  401.  
  402. else
  403.  
  404. h:TakeDamage(Damage * 2)
  405.  
  406. print("Headshot!")
  407.  
  408. --player.Credits.Value = player.Credits.Value + 50
  409.  
  410. --player.PlayerGui.HeadShotGui.Script.Disabled = false
  411.  
  412. local explosion = Instance.new("Explosion")
  413.  
  414. explosion.Position=h.Parent.Torso.Position
  415.  
  416. explosion.BlastRadius=explosion.BlastRadius*2
  417.  
  418. explosion.Parent=workspace
  419.  
  420. char.Head.Transparency=1
  421.  
  422. char.Head.CanCollide=false
  423.  
  424. if char.Head:FindFirstChild("face") then char.Head:FindFirstChild("face").Transparency=1 end
  425.  
  426. for _,v in pairs(char:GetChildren()) do
  427.  
  428. if v.className=="Hat" then
  429.  
  430. v:Destroy()
  431.  
  432. end
  433.  
  434. end
  435.  
  436. for i = 1, 7 do
  437.  
  438. local blood=Instance.new("Part")
  439.  
  440. blood.FormFactor="Custom"
  441.  
  442. blood.Size=Vector3.new(1,.2,1)
  443.  
  444. blood.BrickColor=BrickColor.Red()
  445.  
  446. blood.TopSurface=0
  447.  
  448. blood.BottomSurface=0
  449.  
  450. game:GetService("Debris"):AddItem(blood,5)
  451.  
  452. blood.Parent=workspace
  453.  
  454. blood.Position=char.Head.Position + Vector3.new(math.random(0.2,0.8),0,math.random(0.2,0.8))
  455.  
  456. end
  457.  
  458. local sound = Instance.new("Sound")
  459.  
  460. sound.SoundId = "rbxassetid://142347633"
  461.  
  462. sound.Parent=char.Head
  463.  
  464. sound.Pitch=1.1
  465.  
  466. sound:Play()
  467.  
  468. end
  469.  
  470. PlaySound("Hit1",char.Torso)
  471.  
  472. if h.Health == 0 then
  473.  
  474. PlaySound("Hit2")
  475.  
  476. end
  477.  
  478. elseif hit.Name~="Handle" or hit.Name~="IgnoreThrowingKnives" and hit.Parent.Name~="Arms_Model" and hit.Name~="RayPart" and hit.CanCollide==true then
  479.  
  480. local sound=Instance.new("Sound")
  481.  
  482. sound.Parent=hit
  483.  
  484. sound.SoundId = "rbxassetid://" .. SOUNDS.wallhit[math.random(1,#SOUNDS.wallhit)]
  485.  
  486. sound:Play()
  487.  
  488. sound:Destroy()
  489.  
  490. print("Hit Object: " .. hit.Name)
  491.  
  492. local newknife=tool.Handle:clone()
  493.  
  494. newknife.Name="ThrownKnife"
  495.  
  496. newknife.CFrame = CFrame.new(spawnPos, spawnPos + dPos) * CFrame.Angles(math.pi/-2, 0, 0)
  497.  
  498. newknife.Position = targetpos
  499.  
  500. throwingHandle:Destroy()
  501.  
  502. newknife.Anchored=true
  503.  
  504. newknife.CanCollide=true
  505.  
  506. newknife.Transparency=0
  507.  
  508. newknife.Parent=workspace
  509.  
  510. --newknife.Script.Disabled = false
  511.  
  512. wait(7)
  513.  
  514. for i=1,10 do
  515.  
  516. newknife.Transparency=i*.1
  517.  
  518. wait()
  519.  
  520. end
  521.  
  522. newknife:Destroy()
  523.  
  524. end
  525.  
  526. end
  527.  
  528. end)
  529.  
  530. end
  531.  
  532. end
  533.  
  534. -- must check if it still exists since we waited
  535.  
  536. if throwingHandle then
  537.  
  538. throwingHandle.CanCollide = true
  539.  
  540. end
  541.  
  542.  
  543.  
  544. FUNCTIONS={
  545.  
  546.  
  547. CHECKFORFIRSTPERSON=function()
  548.  
  549. if (camera.focus.p - camera.CoordinateFrame.p).magnitude > 1 then
  550.  
  551. return false
  552.  
  553. else
  554.  
  555. return true
  556.  
  557. end
  558.  
  559. end,
  560.  
  561.  
  562. ANIMS=function(state)
  563.  
  564. if state then
  565.  
  566. mouse.Icon="http://www.roblox.com/asset/?id=258828417"
  567.  
  568. --Start Animation
  569.  
  570.  
  571.  
  572. if SETTINGS.tool then
  573.  
  574. tool.GripPos = Vector3.new(0, -0.55, 0)
  575.  
  576. elseif SETTINGS.tool then
  577.  
  578. tool.GripPos = Vector3.new(0, -0.6, 0)
  579.  
  580. elseif SETTINGS.tool then
  581.  
  582. tool.GripPos = Vector3.new(0, -0.65, 0)
  583.  
  584. elseif SETTINGS.tool then
  585.  
  586. tool.GripPos = Vector3.new(0, -0.7, 0)
  587.  
  588. elseif SETTINGS.tool then
  589.  
  590. tool.GripPos = Vector3.new(0, -0.75, 0)
  591.  
  592. elseif SETTINGS.tool then
  593.  
  594. tool.GripPos = Vector3.new(0, -0.8, 0)
  595.  
  596. elseif SETTINGS.tool then
  597.  
  598. tool.GripPos = Vector3.new(0, -0.85, 0)
  599.  
  600. elseif SETTINGS.tool then
  601.  
  602. tool.GripPos = Vector3.new(0, -0.9, 0)
  603.  
  604. elseif SETTINGS.tool then
  605.  
  606. tool.GripPos = Vector3.new(0, -0.95, 0)
  607.  
  608. elseif SETTINGS.tool then
  609.  
  610. tool.GripPos = Vector3.new(0, -1, 0)
  611.  
  612. else
  613.  
  614. print("Invalid tool size! Set to default: " .. SETTINGS.tool.default_tool_size )
  615.  
  616.  
  617. if SETTINGS.tool.default_tool_size==.1 then
  618.  
  619. tool.GripPos = Vector3.new(0, -0.55, 0)
  620.  
  621. elseif SETTINGS.tool.default_tool_size==.2 then
  622.  
  623. tool.GripPos = Vector3.new(0, -0.6, 0)
  624.  
  625. elseif SETTINGS.tool.default_tool_size==.3 then
  626.  
  627. tool.GripPos = Vector3.new(0, -0.65, 0)
  628.  
  629. elseif SETTINGS.tool.default_tool_size==.4 then
  630.  
  631. tool.GripPos = Vector3.new(0, -0.7, 0)
  632.  
  633. elseif SETTINGS.tool.default_tool_size==.5 then
  634.  
  635. tool.GripPos = Vector3.new(0, -0.75, 0)
  636.  
  637. elseif SETTINGS.tool.default_tool_size==.6 then
  638.  
  639. tool.GripPos = Vector3.new(0, -0.8, 0)
  640.  
  641. elseif SETTINGS.tool.default_tool_size==.7 then
  642.  
  643. tool.GripPos = Vector3.new(0, -0.85, 0)
  644.  
  645. elseif SETTINGS.tool.default_tool_size==.8 then
  646.  
  647. tool.GripPos = Vector3.new(0, -0.9, 0)
  648.  
  649. elseif SETTINGS.tool.default_tool_size==.9 then
  650.  
  651. tool.GripPos = Vector3.new(0, -0.95, 0)
  652.  
  653. elseif SETTINGS.tool.default_tool_size==1 then
  654.  
  655. tool.GripPos = Vector3.new(0, -1, 0)
  656.  
  657. else
  658.  
  659. print("Invalid default size! Un-equipping and removing Knife...")
  660.  
  661.  
  662. end
  663.  
  664. end
  665.  
  666. torso=char:FindFirstChild("Torso")
  667.  
  668. leftarm=torso:FindFirstChild("Left Shoulder")
  669.  
  670. if leftarm then
  671.  
  672. leftarm.Parent=nil
  673.  
  674. newarmweld=Instance.new("Weld")
  675.  
  676. newarmweld.Name="LeftWeld"
  677.  
  678. newarmweld.Part0=torso
  679.  
  680. newarmweld.C0 = CFrame.new(-1.5, 0.7, 0)
  681.  
  682. newarmweld.C1 = CFrame.new(0, 0.7, 0)
  683.  
  684. newarmweld.Part1=char:FindFirstChild("Left Arm")
  685.  
  686. newarmweld.Parent=torso
  687.  
  688. end
  689.  
  690. humanoid.WalkSpeed=WalkSpeeds[2]
  691.  
  692. for i = 1, 15, 3 do
  693.  
  694. if equipped then
  695.  
  696. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  697.  
  698. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  699.  
  700. end
  701.  
  702. wait()
  703.  
  704. end
  705.  
  706. else
  707.  
  708. humanoid.WalkSpeed=WalkSpeeds[1]
  709.  
  710. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.new(0,-0.2,0)
  711.  
  712. tool.GripForward = Vector3.new(0,0,-1)
  713.  
  714. newarmweld:Destroy()
  715.  
  716. leftarm.Parent=torso
  717.  
  718. mouse.Icon=""
  719.  
  720. torso:FindFirstChild("Neck").C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  721.  
  722. torso:FindFirstChild("Right Shoulder").C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  723.  
  724. end
  725.  
  726. end
  727.  
  728. }
  729.  
  730.  
  731.  
  732. tool.Equipped:connect(function ()
  733.  
  734. equipped=true
  735.  
  736. PlaySound("Equip")
  737.  
  738. FUNCTIONS.ANIMS(true)
  739.  
  740. end)
  741.  
  742. tool.Unequipped:connect(function ()
  743.  
  744. equipped=false
  745.  
  746. FUNCTIONS.ANIMS(false)
  747.  
  748. end)
  749.  
  750. tool.Handle.Touched:connect(function (hit)
  751.  
  752. if Attacking then
  753.  
  754. DamageObject(hit)
  755.  
  756. end
  757.  
  758. end)
  759.  
  760. tool.Activated:connect(function ()
  761.  
  762. if Attacking then return end
  763.  
  764. if not tool.Enabled then return end
  765.  
  766. justthrown=false
  767.  
  768. justattacked=false
  769.  
  770. if not gettingknife and not justthrown and not Attacking then
  771.  
  772. HeldTime=time()
  773.  
  774. end
  775.  
  776. playcharge=true
  777.  
  778. wait(.15)
  779.  
  780. while gettingknife do
  781.  
  782. wait()
  783.  
  784. end
  785.  
  786. local speed=0.2
  787.  
  788. for i = 1, 15, fasterthrow do
  789.  
  790. if playcharge and equipped and not gettingknife and not justthrown and not Attacking then
  791.  
  792. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.195277825, -0.747909963, 0.634426773, 0.482016951, 0.636551082, 0.602048457, -0.854123056, 0.188237742, 0.484809577) * CFrame.Angles((i * (math.pi / 50)), 0, (-i * (math.pi / 25)))
  793.  
  794. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0, 0.858912528, 0.165011853, 0.484809607, -0.464581847, 0.649385393, 0.602048457, -0.215483144, -0.742340684, 0.634426773) * CFrame.Angles((-i * (math.pi / 75)),(i * (math.pi / 180)),0)
  795.  
  796. player.Character["Right Arm"].RightGrip.C1 = CFrame.new(0, -0.800000012, 0.05, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.Angles((-i * (math.pi / 150)),0,0)
  797.  
  798. wait()
  799.  
  800. end
  801.  
  802. end
  803.  
  804. if playcharge then
  805.  
  806. canLaser=true
  807.  
  808. end
  809.  
  810. end)
  811.  
  812. tool.Deactivated:connect(function ()
  813.  
  814. if not tool.Enabled then return end
  815.  
  816. currTime=time()
  817.  
  818. playcharge=false
  819.  
  820. if HeldTime and currTime - HeldTime > .6 and
  821.  
  822. currTime - HeldTime > 0.01 and not justthrown and not gettingknife then
  823.  
  824. if not Attacking and not justattacked then
  825.  
  826. print("Throw")
  827.  
  828. if canLaser then
  829.  
  830. PlaySound("ThrowLaser")
  831.  
  832. else
  833.  
  834. PlaySound("Throw")
  835.  
  836. end
  837.  
  838. tool.Handle.Transparency=1
  839.  
  840. local targetPos = player.Character.Humanoid.TargetPoint
  841.  
  842. local lookAt = (targetPos - player.Character.PrimaryPart.Position).unit
  843.  
  844. local switchEvenOddParity = 1
  845.  
  846. local angle = math.ceil((1-1)/2)*math.pi/12*switchEvenOddParity
  847.  
  848. Throwtool(CFrame.Angles(0, angle, 0) * lookAt)
  849.  
  850. wait()
  851. canLaser=true
  852.  
  853. HeldTime=0
  854.  
  855. gettingknife=true
  856.  
  857. mouse.Icon="http://www.roblox.com/asset/?id=258828417"
  858.  
  859. player.Character["Right Arm"].RightGrip.C1 = CFrame.new(0, -0.800000012, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  860.  
  861. for i = 1, 15, .8 do
  862.  
  863. if equipped then
  864.  
  865. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.0719629526, 0.22870943, 0.970831275, -0.981789052, 0.187819958, 0.0285283029, -0.175816804, -0.955204487, 0.238060504) * CFrame.Angles(0, 0, (i * (math.pi / 15)))
  866.  
  867. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, 0.7, 0, 0.703028679, -0.151466534, 0.694844246, -0.673604906, 0.171488613, 0.718921423, -0.228050426, -0.973472893, 0.0185328126) * CFrame.Angles((i * (math.pi / 60)),(-i * (math.pi / 180)),(i * (math.pi / 60)))
  868.  
  869. wait()
  870.  
  871. end
  872.  
  873. end
  874.  
  875. justthrown=true
  876.  
  877. tool.Handle.Transparency=0
  878.  
  879. PlaySound("Equip")
  880.  
  881. mouse.Icon="http://www.roblox.com/asset/?id=258828417"
  882.  
  883. tool.GripForward = Vector3.new(0,0,-1)
  884.  
  885. for i = 1, 15, 1 do
  886.  
  887. if equipped then
  888.  
  889. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, -0.071962975, -0.22870943, 0.970831275, 0.981789052, -0.187820047, 0.0285283029, 0.175816894, 0.955204487, 0.238060504) * CFrame.Angles(0, 0, (-i * (math.pi / 30)))
  890.  
  891. wait()
  892.  
  893. end
  894.  
  895. end
  896.  
  897. gettingknife=false
  898.  
  899. for i = 1, 15, 3 do
  900.  
  901. if equipped then
  902.  
  903. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  904.  
  905. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  906.  
  907. end
  908.  
  909. wait()
  910.  
  911. end
  912.  
  913. end
  914.  
  915. else
  916.  
  917. if not justthrown and not gettingknife then
  918.  
  919. if Attacking then return end
  920.  
  921. print("Attack")
  922.  
  923. HeldTime=0
  924.  
  925. Attacking=true
  926.  
  927. justattacked=true
  928.  
  929. if math.random(1,2)==1 then
  930.  
  931. for i = 1, 15, 3 do
  932.  
  933. if equipped and not gettingknife and not justthrown then
  934.  
  935. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.195277825, -0.747909963, 0.634426773, 0.482016951, 0.636551082, 0.602048457, -0.854123056, 0.188237742, 0.484809577) * CFrame.Angles((i * (math.pi / 65)), 0, (-i * (math.pi / 30)))
  936.  
  937. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0, 0.858912528, 0.165011853, 0.484809607, -0.464581847, 0.649385393, 0.602048457, -0.215483144, -0.742340684, 0.634426773) * CFrame.Angles((-i * (math.pi / 75)),(i * (math.pi / 180)),0)
  938.  
  939. wait()
  940.  
  941. end
  942.  
  943. end
  944.  
  945. PlaySound("Swing")
  946.  
  947. for i = 1, 15, 3 do
  948.  
  949. if equipped and not gettingknife and not justthrown then
  950.  
  951. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.0719629526, 0.22870943, 0.970831275, -0.981789052, 0.187819958, 0.0285283029, -0.175816804, -0.955204487, 0.238060504) * CFrame.Angles(0, 0, (i * (math.pi / 15)))
  952.  
  953. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, 0.7, 0, 0.703028679, -0.151466534, 0.694844246, -0.673604906, 0.171488613, 0.718921423, -0.228050426, -0.973472893, 0.0185328126) * CFrame.Angles((i * (math.pi / 60)),(-i * (math.pi / 180)),(i * (math.pi / 60)))
  954.  
  955. wait()
  956.  
  957. end
  958.  
  959. end
  960.  
  961. for i = 1, 15, 3 do
  962.  
  963. if equipped and not justthrown and not gettingknife then
  964.  
  965. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, -0.071962975, -0.22870943, 0.970831275, 0.981789052, -0.187820047, 0.0285283029, 0.175816894, 0.955204487, 0.238060504) * CFrame.Angles(0, 0, (-i * (math.pi / 30)))
  966.  
  967. wait()
  968.  
  969. end
  970.  
  971. end
  972.  
  973. for i = 1, 15, 3 do
  974.  
  975. equipping=true
  976.  
  977. if equipped and not gettingknife and not justthrown then
  978.  
  979. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  980.  
  981. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  982.  
  983. end
  984.  
  985. wait()
  986.  
  987. end
  988.  
  989. Attacking=false
  990.  
  991. else
  992.  
  993. for i = 1, 15, 3 do
  994.  
  995. if equipped and not gettingknife and not justthrown then
  996.  
  997. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.3, 0.5, 0, 0.195277825, -0.747909963, 0.634426773, 0.482016951, 0.636551082, 0.602048457, -0.854123056, 0.188237742, 0.484809577) * CFrame.Angles((i * (math.pi / 40)),(-i * (math.pi / 45)),(i * (math.pi / 60)))
  998.  
  999. end
  1000.  
  1001. wait()
  1002.  
  1003. end
  1004.  
  1005. PlaySound("Swing")
  1006.  
  1007. for i = 1, 15, 3 do
  1008.  
  1009. if equipped and not gettingknife and not justthrown then
  1010.  
  1011. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.2, 0.5, -.3, 0.852928281, -0.428775758, 0.29776603, 0.516928136, 0.614185035, -0.596290231, 0.0727913082, 0.662516415, 0.745502114) * CFrame.Angles((-i * (math.pi / 45)),0,0)
  1012.  
  1013. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.200000003, 0.7, 0, 0.849384904, 0.16895318, 0.5, -0.48470962, 0.624545038, 0.612372398, -0.208810255, -0.762494743, 0.612372398) * CFrame.Angles((i * (math.pi / 60)),(-i * (math.pi / 180)),(i * (math.pi / 60)))
  1014.  
  1015. end
  1016.  
  1017. wait()
  1018.  
  1019. end
  1020.  
  1021. for i = 1, 15, 3 do
  1022.  
  1023. if equipped and not gettingknife and not justthrown then
  1024.  
  1025. torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.3, 0.5, -0.300000012, 0.852928281, -0.472260833, -0.222447708, 0.516928136, 0.82349503, 0.233754784, 0.0727913082, -0.314365625, 0.946507096) * CFrame.Angles((i * (math.pi / 45)),0,0)
  1026.  
  1027. end
  1028.  
  1029. wait()
  1030.  
  1031. end
  1032.  
  1033. for i = 1, 15, 3 do
  1034.  
  1035. if equipped and not gettingknife and not justthrown then
  1036.  
  1037. torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
  1038.  
  1039. torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
  1040.  
  1041. end
  1042.  
  1043. wait()
  1044.  
  1045. end
  1046.  
  1047. Attacking=false
  1048.  
  1049. end
  1050.  
  1051. end
  1052.  
  1053. end
  1054.  
  1055. end)
  1056.  
  1057.  
  1058.  
  1059. mouse.Move:connect(function ()
  1060.  
  1061. if equipped and mouse then
  1062.  
  1063. if (mouse.Hit.p - mouse.Origin.p).unit.y < 0.25 and (mouse.Hit.p - mouse.Origin.p).unit.y > -0.25 then
  1064.  
  1065. torso:FindFirstChild("Right Shoulder").C0 = CFrame.new(.9,.5,0) * CFrame.Angles(0,math.rad(90),0) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))
  1066.  
  1067. torso:FindFirstChild("LeftWeld").C0 = CFrame.new(-1.5,0.5,0) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))
  1068.  
  1069. torso:FindFirstChild("Neck").C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),0,math.rad(180)) * CFrame.Angles(math.asin(-(mouse.Hit.p - mouse.Origin.p).unit.y), 0, 0)
  1070.  
  1071. end
  1072.  
  1073. end
  1074.  
  1075. end)
  1076.  
  1077. print("Music executed!")
  1078.  
  1079. s = Instance.new("Sound")
  1080.  
  1081. s.Name = "Music"
  1082.  
  1083. s.SoundId = "http://www.roblox.com/asset/?id=276873987" --Put the id into there.
  1084.  
  1085. s.Looped = true
  1086.  
  1087. s.Pitch = 1 --You can edit these settings.
  1088.  
  1089. s.Volume = 10 --You can edit these settings.
  1090.  
  1091. s.archivable = false
  1092.  
  1093.  
  1094.  
  1095. s.Parent = game.Workspace
  1096.  
  1097.  
  1098.  
  1099. wait(1)
  1100.  
  1101.  
  1102. s:play()
  1103.  
  1104. lp=game.Players.LocalPlayer
  1105. chr=lp.Character
  1106. attacking=false
  1107. mouse = game.Players.LocalPlayer:GetMouse()
  1108.  
  1109. Lightning = function(Start,End,Times,Offset,Color,Thickness,Transparency)
  1110. local magz = (Start - End).magnitude local curpos = Start local trz = {-Offset,Offset}
  1111. for i=1,Times do
  1112. local li = Instance.new("Part",workspace)
  1113. li.TopSurface =0
  1114. li.BottomSurface = 0
  1115. li.Anchored = true
  1116. li.Material = 288
  1117. li.Transparency = Transparency or 0.4
  1118. li.BrickColor = BrickColor.new("Gold")
  1119. li.formFactor = "Custom"
  1120. li.CanCollide = false
  1121. li.Size = Vector3.new(Thickness,Thickness,magz/Times) local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)])
  1122. local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz
  1123. if Times == i then
  1124. local magz2 = (curpos - End).magnitude li.Size = Vector3.new(Thickness,Thickness,magz2)
  1125. li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2)
  1126. else
  1127. li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2)
  1128. end
  1129. curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p game.Debris:AddItem(li,0.25)
  1130. end
  1131. end
  1132.  
  1133. mouse.KeyDown:connect(function(key)
  1134. key:lower()
  1135. if key == "e" and attacking == false then
  1136. wait()
  1137. for i=1,5 do
  1138. Lightning(chr.Torso.Position,mouse.Hit.p,10,math.random(5,10),math.random(-2.5,2.5),"New Yeller",0.05,0.3)
  1139. end
  1140. Wait()
  1141. x=Instance.new("Part",chr)
  1142. x.Transparency=1
  1143. x.Material = 288
  1144. x.Position=mouse.Hit.p
  1145. chr.Torso.CFrame=x.CFrame*CFrame.new(0,5,0)
  1146. x:Destroy()
  1147. end
  1148. end)
  1149.  
  1150. while not getmetatable(shared) do
  1151. wait()
  1152. end
  1153. shared(script)
  1154. local p = game.Players.LocalPlayer
  1155. local bkp = p:WaitForChild("Backpack")
  1156. local char = p.Character
  1157. local bc = char["Body Colors"]
  1158. local mouse = p:GetMouse()
  1159. local la = char["Left Arm"]
  1160. local ra = char["Right Arm"]
  1161. local ll = char["Left Leg"]
  1162. local rl = char["Right Leg"]
  1163. local hed = char.Head
  1164. local tor = char.Torso
  1165. local hum = char.Humanoid
  1166. local cam = workspace.CurrentCamera or workspace.Camera
  1167. local min = 1
  1168. local max = 2
  1169. local autism = false
  1170. local CanGoThroughPlayers = true
  1171. bc.LeftArmColor = BrickColor.new("Bright yellow")
  1172. bc.RightArmColor = BrickColor.new("Bright yellow")
  1173. bc.HeadColor = BrickColor.new("Bright yellow")
  1174. bc.LeftLegColor = BrickColor.new("Bright green")
  1175. bc.RightLegColor = BrickColor.new("Bright green")
  1176. bc.TorsoColor = BrickColor.new("Bright blue")
  1177. function FF()
  1178. ff = Instance.new("ForceField", char)
  1179. ff:Destroy()
  1180. end
  1181. char.Archivable = true
  1182. for i, v in pairs(char:GetChildren()) do
  1183. if v:IsA("Part") then
  1184. v.Anchored = true
  1185. end
  1186. if v:IsA("Hat") then
  1187. v:Destroy()
  1188. end
  1189. end
  1190. clon = char:Clone()
  1191. clon.Parent = char
  1192. clon.Humanoid:Remove()
  1193. function God()
  1194. clon.Parent = char.Parent
  1195. char.Parent = cam
  1196. local rekt = Instance.new("Model", char)
  1197. rekt.Name = "ACTIVE"
  1198. clon.Archivable = false
  1199. end
  1200. local cla = clon["Left Arm"]
  1201. local cra = clon["Right Arm"]
  1202. local cll = clon["Left Leg"]
  1203. local crl = clon["Right Leg"]
  1204. local ched = clon.Head
  1205. local ctor = clon.Torso
  1206. for i, v in pairs(clon:GetChildren()) do
  1207. if v:IsA("Part") then
  1208. v.TopSurface = "Studs"
  1209. v.BottomSurface = "Inlet"
  1210. v.CanCollide = false
  1211. v.FrontSurface = "Smooth"
  1212. v.BackSurface = "Smooth"
  1213. if v.Name == "Torso" then
  1214. v.LeftSurface = "Smooth"
  1215. v.RightSurface = "Smooth"
  1216. end
  1217. end
  1218. if v:IsA("Accoutrement") then
  1219. v:Remove()
  1220. end
  1221. end
  1222. for i, v in pairs(char:GetChildren()) do
  1223. if v:IsA("Part") then
  1224. v.Transparency = 1
  1225. v.Anchored = false
  1226. end
  1227. if v:IsA("Accoutrement") then
  1228. v:Remove()
  1229. end
  1230. end
  1231. if hed:findFirstChild("face") then
  1232. hed.face:Remove()
  1233. end
  1234. ArtificialHB = Instance.new("BindableEvent", script)
  1235. ArtificialHB.Name = "Heartbeat"
  1236. script:WaitForChild("Heartbeat")
  1237. frame = 0.03333333333333333
  1238. tf = 0
  1239. allowframeloss = true
  1240. tossremainder = false
  1241. lastframe = tick()
  1242. script.Heartbeat:Fire()
  1243. game:GetService("RunService").Heartbeat:connect(function(s, p)
  1244. tf = tf + s
  1245. if tf >= frame then
  1246. if allowframeloss then
  1247. script.Heartbeat:Fire()
  1248. lastframe = tick()
  1249. else
  1250. for i = 1, math.floor(tf / frame) do
  1251. script.Heartbeat:Fire()
  1252. end
  1253. lastframe = tick()
  1254. end
  1255. if tossremainder then
  1256. tf = 0
  1257. else
  1258. tf = tf - frame * math.floor(tf / frame)
  1259. end
  1260. end
  1261. end)
  1262. game:GetService("RunService").Stepped:connect(function()
  1263. if CanGoThroughPlayers and game.Players ~= nil and game.Players.LocalPlayer ~= nil and game.Players.LocalPlayer.Character ~= nil and game.Players.LocalPlayer.Character:FindFirstChild("Torso") ~= nil and game.Players.LocalPlayer.Character:FindFirstChild("Head") ~= nil then
  1264. game.Players.LocalPlayer.Character.Torso.CanCollide = false
  1265. game.Players.LocalPlayer.Character.Head.CanCollide = false
  1266. end
  1267. end)
  1268. cla_size = Vector3.new(1, 2, 1)
  1269. cra_size = Vector3.new(1, 2, 1)
  1270. ched_size = Vector3.new(2, 1, 1)
  1271. ctor_size = Vector3.new(2, 2, 1)
  1272. cll_size = Vector3.new(1, 2, 1)
  1273. crl_size = Vector3.new(1, 2, 1)
  1274. God()
  1275. game:GetService("RunService").RenderStepped:connect(function()
  1276. for _, hb in pairs(bkp:GetChildren()) do
  1277. if hb.Name == "HopperBin" then
  1278. hb:Destroy()
  1279. end
  1280. end
  1281. wait(0.5)
  1282. for i, v in pairs(char:GetChildren()) do
  1283. if v:IsA("Part") then
  1284. v.CanCollide = false
  1285. end
  1286. end
  1287. cla.CFrame = la.CFrame
  1288. cra.CFrame = ra.CFrame
  1289. ched.CFrame = hed.CFrame
  1290. ctor.CFrame = tor.CFrame
  1291. cll.CFrame = ll.CFrame
  1292. crl.CFrame = rl.CFrame
  1293. for i, v in pairs(clon:GetChildren()) do
  1294. if v:IsA("Part") then
  1295. v.CanCollide = false
  1296. end
  1297. end
  1298. if autism then
  1299. cla.Size = cla_size * Vector3.new(math.random(min, max), math.random(min, max), math.random(min, max))
  1300. cra.Size = cra_size * Vector3.new(math.random(min, max), math.random(min, max), math.random(min, max))
  1301. ched.Size = ched_size * Vector3.new(math.random(min, max), math.random(min, max), math.random(min, max))
  1302. ctor.Size = ctor_size * Vector3.new(math.random(min, max), math.random(min, max), math.random(min, max))
  1303. cll.Size = cll_size * Vector3.new(math.random(min, max), math.random(min, max), math.random(min, max))
  1304. crl.Size = crl_size * Vector3.new(math.random(min, max), math.random(min, max), math.random(min, max))
  1305. end
  1306. end)
  1307.  
  1308. --[[
  1309. Smith and Wesson M&P 45, chambered in .45 ACP ammunition.
  1310. The standard magazine holds 10 rounds, although magazines that could hold 14 rounds were also made but looked incredibly stupid.
  1311. Credit to litozinnamon for the crosshairs and bullethole decals. I used them without permission. Not like I asked him, anyhow.
  1312. ]]
  1313.  
  1314. plr=game:service'Players'.LocalPlayer
  1315. ch,char=plr.Character,plr.Character
  1316. hum=ch.Humanoid
  1317. tor,torso,rootpart,rj=ch.Torso,ch.Torso,ch.HumanoidRootPart,ch.HumanoidRootPart.RootJoint
  1318. m,mouse=plr:GetMouse(),plr:GetMouse()
  1319. cfn,ang,mr,int=CFrame.new,CFrame.Angles,math.rad,Instance.new
  1320. bc=BrickColor.new
  1321. head=ch.Head
  1322. cam=workspace.CurrentCamera
  1323.  
  1324. rj.C0=cfn()
  1325. rj.C1=cfn()
  1326.  
  1327. sheathed=false
  1328. jammed=false
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340. 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
  1341. local surface_between_splitted_parts = 'SmoothNoOutlines' --the surface between splitted parts
  1342. --local fragmented = workspace:FindFirstChild("Fragmented")
  1343. local fragmentable = workspace --all fragmentable objects should be stored in here
  1344. local list = {}
  1345. local brickcount = 0
  1346. --local m = Instance.new("Hint",workspace)
  1347. local storage = {}
  1348. 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.
  1349. local maximumstorage = 2000 --it will recycle parts if the number of parts in the storage doesnt exceed this number
  1350. local storage_position = Vector3.new(0,0,5000) --place them somewhere off the map
  1351. local stored_partsize = Vector3.new(1,1,1) --make them small
  1352. local parts_created_per_frame = 5 --number of parts being created per frame to fill up the storage
  1353.  
  1354.  
  1355. function fragmentate(cframe,size,color,explosion_position,explosion_blastradius,backsurface,bottomsurface,frontsurface,leftsurface,rightsurface,topsurface,transparency,reflectance)
  1356. 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...
  1357. local yi = size.Y >= minimumsize.Y*(1+explosion_blastradius/16) and 2 or 1
  1358. local zi = size.Z >= minimumsize.Z*(1+explosion_blastradius/16) and 2 or 1
  1359. 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
  1360. if xi == 1 and yi == 1 and zi == 1 then return end --optional
  1361. if #storage > 0 then
  1362. local p = storage[1]
  1363. p.BrickColor = color
  1364. p.Size = size
  1365. p.BackSurface = backsurface
  1366. p.BottomSurface = bottomsurface
  1367. p.FrontSurface = frontsurface
  1368. p.LeftSurface = leftsurface
  1369. p.RightSurface = rightsurface
  1370. p.TopSurface = topsurface
  1371. p.Transparency = transparency
  1372. p.CFrame = cframe
  1373. p.Reflectance = reflectance
  1374. table.remove(storage,1)
  1375. else
  1376. local p = Instance.new("Part",fragmentable)
  1377. p.BrickColor = color
  1378. p.FormFactor = "Custom"
  1379. p.Size = size
  1380. p.BackSurface = backsurface
  1381. p.BottomSurface = bottomsurface
  1382. p.FrontSurface = frontsurface
  1383. p.LeftSurface = leftsurface
  1384. p.RightSurface = rightsurface
  1385. p.TopSurface = topsurface
  1386. p.Transparency = transparency
  1387. if p.Transparency>0.285 then
  1388. p.Anchored = false
  1389. else
  1390. p.Anchored=true
  1391. p.Material='Wood'
  1392. end
  1393. p.CFrame = cframe
  1394. p.Reflectance = reflectance
  1395. end
  1396. --p:MakeJoints()
  1397. -- m.Text = m.Text+1
  1398. return --stop the function
  1399. end
  1400. local mody = math.random(-125,125)/1000 --some randomization
  1401. for y = 1,yi do
  1402. if math.random()> 0.5 then
  1403. local modx = math.random(-125,125)/1000
  1404. for x = 1,xi do
  1405. local modz = math.random(-125,125)/1000
  1406. for z = 1,zi do --offset = x/xi-0.75+modx)
  1407. 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
  1408. 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,
  1409. 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,
  1410. z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
  1411. 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,
  1412. y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance)
  1413. end
  1414.  
  1415. end
  1416. else
  1417. local modz = math.random(-125,125)/1000
  1418. for z = 1,zi do
  1419. local modx = math.random(-125,125)/1000
  1420. for x = 1,xi do
  1421. 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)),
  1422. 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,
  1423. zi == 2 and size.Z*(1-2*math.abs(z/zi-0.75+modz)) or size.Z),color,explosion_position,explosion_blastradius,
  1424. z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
  1425. 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,
  1426. y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance)
  1427. end
  1428. end
  1429. end
  1430. end
  1431. end
  1432.  
  1433. function start_fragmentation(position,radius)
  1434. local search = Region3.new(position-Vector3.new(radius,radius,radius)*1.1,position+Vector3.new(radius,radius,radius)*1.1)
  1435. repeat
  1436. local finish = false
  1437. 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
  1438. for i = 1,#parts do
  1439. table.insert(list,1,parts[i])
  1440. end
  1441. finish = true
  1442. until #parts < 100 and finish
  1443. print(#list)
  1444. local t = tick()
  1445. for i = 1,#list do
  1446. local p = list[i]
  1447. if p:IsDescendantOf(fragmentable) and p:GetMass()<3000 and p.Transparency>0.285 and p.Name~='Base' and p:IsDescendantOf(ch)==false then
  1448. 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)
  1449. if #storage < maximumstorage and p.Shape == "Block" then --recycle them
  1450. p.Anchored = false
  1451. p.FormFactor = "Custom"
  1452. p.Size = stored_partsize
  1453. p.Position = storage_position
  1454. table.insert(storage,1,p)
  1455. else --storage is full
  1456. p:Destroy()
  1457. end
  1458. -- m.Text = m.Text-1
  1459. end
  1460. 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
  1461. 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)
  1462. if #storage < maximumstorage and p.Shape == "Block" then --recycle them
  1463. p.Anchored = true
  1464. p.Material='Wood'
  1465. p.FormFactor = "Custom"
  1466. p.Size = stored_partsize
  1467. p.Position = storage_position
  1468. table.insert(storage,1,p)
  1469. else --storage is full
  1470. p:Destroy()
  1471. end
  1472. -- m.Text = m.Text-1
  1473. end
  1474. end
  1475. list = {}
  1476. -- print(tick()-t)
  1477. end
  1478.  
  1479. --[[
  1480. spawn(function()
  1481. while wait() do --oh noes,a loop! So inefficient!
  1482. if #storage < fillup then
  1483. for i = 1, parts_created_per_frame do --creates parts to fill up the storage
  1484. local p = Instance.new("Part",fragmentable)
  1485. p.Anchored = false
  1486. p.FormFactor = "Custom"
  1487. p.Size = stored_partsize
  1488. p.Position = storage_position
  1489. table.insert(storage,1,p)
  1490. end
  1491. end
  1492. end
  1493. end)
  1494. ]]
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518. --local blankn=22416261
  1519.  
  1520. --172121567
  1521.  
  1522. crosshairs={
  1523. {38140824};
  1524. {38140833};
  1525. {38140839};
  1526. {38140843};
  1527. {38140852};
  1528. {38140910};
  1529. {38140915};
  1530. {38140923};
  1531. {38140928};
  1532. {38140931};
  1533. {38208259};
  1534. {38208275};
  1535. {38208284};
  1536. {38208303};
  1537. {38208310};
  1538. {38208325};
  1539. {38208330};
  1540. {38208352};
  1541. {38208359};
  1542. {38208377}
  1543. }
  1544.  
  1545. bulletholes={
  1546. 172274695;
  1547. 172274721
  1548. }
  1549.  
  1550. for _,v in pairs(crosshairs) do
  1551. game:service'ContentProvider':Preload('rbxassetid://' .. tostring(v[1]-1))
  1552. end
  1553.  
  1554. currentIco=2
  1555. switchIco=function(num)
  1556. if num<20 then
  1557. else
  1558. num=20
  1559. end
  1560. mouse.Icon='rbxassetid://' .. tostring(crosshairs[num][1]-1)
  1561. currentIco=num
  1562. end
  1563.  
  1564. switchIco(currentIco)
  1565.  
  1566. heldDown=false
  1567.  
  1568. spreadint=1
  1569. --[[Settings]]--
  1570. recoil=false -- Set to true for added realism
  1571. magCapacity=20 -- How much a magazine can hold at once
  1572. magAmmo=20 -- How much ammo is in the mag
  1573. crosshairSpread=5
  1574. spread=1
  1575. pAmmunition=true -- more damage if true
  1576.  
  1577.  
  1578. jamRate=500 -- How often the gun jams(the more the less) (no less than 1)
  1579.  
  1580. primaryColor='Really black'
  1581. secondaryColor='Really black'
  1582.  
  1583. slideReflectance=0.01
  1584. slideMaterial='Plastic'
  1585.  
  1586. --[[Attachments]]--
  1587.  
  1588. silencer=true
  1589. highCapMag=false -- High capacity magazine
  1590. laser=true
  1591. automatic=false
  1592. grip=true
  1593.  
  1594.  
  1595. getSound=function(id)
  1596. game:service'ContentProvider':Preload('rbxassetid'..tostring(id))
  1597. local s=int("Sound",ch.Head)
  1598. s.SoundId='rbxassetid://' .. tostring(id)
  1599. s.Volume=1
  1600. return s
  1601. end
  1602.  
  1603. local fireSound=getSound(151997297--[[10209842]])
  1604. fireSound.Pitch=1.3
  1605. --1.8
  1606.  
  1607. local releaseSound=getSound(10209813)
  1608. releaseSound.Pitch=4
  1609.  
  1610. local reloadSound=getSound(10209636)
  1611. reloadSound.Pitch=3
  1612.  
  1613. local magazinelockSound=getSound(152206337)
  1614. magazinelockSound.Pitch=1.4
  1615.  
  1616. local slideBackSound=getSound(152206263)
  1617. slideBackSound.Pitch=2.5
  1618.  
  1619. local slideForwardSound=getSound(152206302)
  1620. slideForwardSound.Pitch=2.5
  1621.  
  1622. local emptySound=getSound(2697295)
  1623. emptySound.Pitch=5
  1624.  
  1625. local glassBreakSound=getSound(144884907)
  1626.  
  1627. local woodImpact=getSound(142082171)
  1628.  
  1629. local fleshImpact=getSound(144884872)
  1630. fleshImpact.Pitch=1.7
  1631.  
  1632. if ch:findFirstChild("Tec-99") then
  1633. ch['Tec-99']:Destroy()
  1634. end
  1635.  
  1636. local tube=int("Model",ch)
  1637. tube.Name='Tec-99'
  1638. local hopper=Instance.new('HopperBin',plr.Backpack)
  1639. hopper.Name=tube.Name
  1640. 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.
  1641. p0.Position = p1.Position
  1642. local w = Instance.new('Motor',par or p0)
  1643. w.Part0 = p1
  1644. w.Part1 = p0
  1645. w.C0 = CFrame.new(x or 0,y or 0,z or 0)*CFrame.Angles(rx or 0,ry or 0,rz or 0)
  1646. w.MaxVelocity = .1
  1647. return w
  1648. end
  1649. function clerp(c1,c2,sp)
  1650. local R1,R2,R3 = c1:toEulerAnglesXYZ()
  1651. local R21,R22,R23 = c2:toEulerAnglesXYZ()
  1652. return CFrame.new(
  1653. c1.X + (c2.X-c1.X)*sp,
  1654. c1.Y + (c2.Y-c1.Y)*sp,
  1655. c1.Z + (c2.Z-c1.Z)*sp)*CFrame.Angles(
  1656. R1 + (R21-R1)*sp,
  1657. R2 + (R22-R2)*sp,
  1658. R3 + (R23-R3)*sp
  1659. )
  1660. end
  1661.  
  1662. tweenTable={}
  1663. Tween = function(Weld, Stop, Step,a)
  1664. ypcall(function()
  1665. local func = function()
  1666. local Start = Weld.C1
  1667. local X1, Y1, Z1 = Start:toEulerAnglesXYZ()
  1668. local Stop = Stop
  1669. local X2, Y2, Z2 = Stop:toEulerAnglesXYZ()
  1670. if not Step then Step=0.1 end
  1671. 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})
  1672. end
  1673. if a then coroutine.wrap(func)() else func() end
  1674. end)
  1675. end
  1676. weld=function(p0,p1,c0)
  1677. local w=Instance.new("Weld",p0)
  1678. w.Part0=p0
  1679. w.Part1=p1
  1680. w.C0=c0
  1681. return w
  1682. end
  1683. cp=function(parent,color,size,anchored,cancollide)
  1684. local newp=Instance.new("Part",parent)
  1685. newp.TopSurface='SmoothNoOutlines'
  1686. newp.BottomSurface='SmoothNoOutlines'
  1687. newp.FrontSurface='SmoothNoOutlines'
  1688. newp.BackSurface='SmoothNoOutlines'
  1689. newp.RightSurface='SmoothNoOutlines'
  1690. newp.LeftSurface='SmoothNoOutlines'
  1691. newp.FormFactor="Custom"
  1692. newp.BrickColor=bc(color)
  1693. newp.Size=size
  1694. newp.Anchored=anchored
  1695. newp.CanCollide=cancollide
  1696. newp:BreakJoints()
  1697. return newp
  1698. end
  1699.  
  1700. initializeJoints=function()
  1701. rabr = cp(tube,'White',Vector3.new(1,1,1),false,false) rabr.Transparency = 1 rabr.Name='Locker'
  1702. rabr.Position = torso.Position
  1703. rw = Weld(rabr,torso,1.5,.5,0,0,0,0) rw.Parent = tube rw.Name = 'rw'
  1704. w = Instance.new("Weld",tube)
  1705. w.Part0,w.Part1 = ch['Right Arm'],rabr
  1706. w.C1 = CFrame.new(0,-.5,0)
  1707. labr = cp(tube,'White',Vector3.new(1,1,1),false,false) labr.Transparency = 1 labr.Name='Locker'
  1708. labr.Position = torso.Position
  1709. lw = Weld(labr,torso,-1.5,.5,0,0,0,0) lw.Parent = tube lw.Name = 'lw'
  1710. ww = Instance.new("Weld",tube)
  1711. ww.Part0,ww.Part1 = ch['Left Arm'],labr
  1712. ww.C1 = CFrame.new(0,-.5,0)
  1713. end
  1714.  
  1715. initializeJoints()
  1716.  
  1717. --[[ leg locks
  1718. rabl = cp(tube,'White',Vector3.new(1,1,1),false,false) rabl.Transparency = 1 rabl.Name='Locker'
  1719. rabl.Position = torso.Position
  1720. rwl = Weld(rabl,torso,0.5,-1.5,0,0,0,0) rwl.Parent = tube rwl.Name = 'rwl'
  1721. wl = Instance.new("Weld",tube)
  1722. wl.Part0,wl.Part1 = ch['Right Leg'],rabl
  1723. wl.C1 = CFrame.new(0,-.5,0)
  1724. labl = cp(tube,'White',Vector3.new(1,1,1),false,false) labl.Transparency = 1 labl.Name='Locker'
  1725. labl.Position = torso.Position
  1726. lwl = Weld(labl,torso,-0.5,-1.5,0,0,0,0) lwl.Parent = tube lwl.Name = 'lwl'
  1727. wwl = Instance.new("Weld",tube)
  1728. wwl.Part0,wwl.Part1 = ch['Left Leg'],labl
  1729. wwl.C1 = CFrame.new(0,-.5,0)
  1730. ]]
  1731. --weld(ch['HumanoidRootPart'],torso,cfn())
  1732.  
  1733.  
  1734. local counter=Instance.new('ScreenGui',plr.PlayerGui)
  1735. local frame=Instance.new('Frame',counter)
  1736. frame.Size=UDim2.new(0.25,0,0.3,0)
  1737.  
  1738. frame.Position=UDim2.new(0.1,0,0.4,0)
  1739. frame.BackgroundTransparency=1
  1740.  
  1741. local ammocounter=Instance.new('TextLabel',frame)
  1742. ammocounter.Size=UDim2.new(1,0,0.3,0)
  1743. ammocounter.Position=UDim2.new(0,0,0.2,0)
  1744. ammocounter.BackgroundTransparency=1
  1745. ammocounter.TextColor3=BrickColor.new('White').Color
  1746. ammocounter.Font='SourceSansBold'
  1747. ammocounter.FontSize='Size18'
  1748. ammocounter.Text=''
  1749. ammocounter.TextXAlignment='Left'
  1750.  
  1751.  
  1752. local bg = Instance.new("BodyGyro",rootpart)
  1753. bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  1754. bg.P = 10000
  1755. bg.D = 100
  1756.  
  1757.  
  1758. cyl=function(prt)
  1759. local c=int("CylinderMesh",prt)
  1760. return c
  1761. end
  1762. blo=function(prt)
  1763. local c=int("BlockMesh",prt)
  1764. return c
  1765. end
  1766.  
  1767. if laser then
  1768. aLaser=cp(tube,'Really red',Vector3.new(0.2,0.2,0.2))
  1769. aLaser.Transparency=1
  1770. cyl(aLaser).Scale=Vector3.new(0.25,1,0.25)
  1771. aLaser.Anchored=true
  1772. end
  1773.  
  1774. local handle=cp(tube,primaryColor,Vector3.new(0.2,0.6,0.3))
  1775. blo(handle).Scale=Vector3.new(1.15,0.9,1)
  1776. 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)))
  1777.  
  1778. local framepiece1=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.9))
  1779. blo(framepiece1).Scale=Vector3.new(1.15,0.5,1)
  1780. weld(handle,framepiece1,cfn(0,0.354,-0.3)*ang(mr(11.5),0,0))
  1781.  
  1782. local barrel=cp(tube,'Medium stone grey',Vector3.new(0.2,0.2,0.2))
  1783. cyl(barrel).Scale=Vector3.new(0.7,1.2,0.7)
  1784. weld(framepiece1,barrel,cfn(0,0.15,-0.1)*ang(mr(-90),0,0))
  1785.  
  1786. local sbarrel=cp(tube,'Really black',Vector3.new(0.2,0.3,0.2))
  1787. cyl(sbarrel).Scale=Vector3.new(0.7,1.5,0.7)
  1788. weld(barrel,sbarrel,cfn(0,0.35,0))
  1789. local hole=cp(tube,'White',Vector3.new(0.2,0.2,0.2))
  1790. hole.Transparency=1
  1791. weld(sbarrel,hole,cfn(0,0.2,0))
  1792. local flash=int('PointLight',hole)
  1793. flash.Enabled=false
  1794. flash.Range=10
  1795. flash.Color=BrickColor.new('Neon orange').Color
  1796.  
  1797.  
  1798. local slide1=cp(tube,secondaryColor,Vector3.new(0.2,0.2,0.4))
  1799. slide1.CanCollide=false
  1800. blo(slide1).Scale=Vector3.new(0.7,1,1.1)
  1801. slideweld1=weld(framepiece1,slide1,cfn(0,0.15,0.23))
  1802. slide1.Reflectance=slideReflectance
  1803. slide1.Material=slideMaterial
  1804.  
  1805. local slide2=cp(tube,secondaryColor,Vector3.new(0.2,0.2,0.4))
  1806. slide2.CanCollide=false
  1807. blo(slide2).Scale=Vector3.new(0.7,1,1.1)
  1808. slideweld2=weld(slide1,slide2,cfn(0,0,-0.666))
  1809. slide2.Reflectance=slideReflectance
  1810. slide2.Material=slideMaterial
  1811.  
  1812. local slideside1=cp(tube,secondaryColor,Vector3.new(0.2,0.2,1.1))
  1813. slideside1.CanCollide=true
  1814. blo(slideside1).Scale=Vector3.new(0.25,1,1)
  1815. weld(slide1,slideside1,cfn(-0.09,0,-0.335))
  1816. slideside1.Reflectance=slideReflectance
  1817. slideside1.Material=slideMaterial
  1818.  
  1819. local slideside2=cp(tube,secondaryColor, Vector3.new(0.2,0.2,0.4))
  1820. slideside2.CanCollide=true
  1821. blo(slideside2).Scale=Vector3.new(0.25,1,1.1)
  1822. weld(slide1,slideside2,cfn(0.09,0,0))
  1823. slideside2.Reflectance=slideReflectance
  1824. slideside2.Material=slideMaterial
  1825.  
  1826. local slideside3=cp(tube,secondaryColor, Vector3.new(0.2,0.2,0.3))
  1827. slideside3.CanCollide=true
  1828. blo(slideside3).Scale=Vector3.new(0.25,0.6,0.78)
  1829. weld(slideside2,slideside3,cfn(0,-0.04,-0.335))
  1830. slideside3.Reflectance=slideReflectance
  1831. slideside3.Material=slideMaterial
  1832.  
  1833. local slideside4=cp(tube,secondaryColor, Vector3.new(0.2,0.2,0.4))
  1834. blo(slideside4).Scale=Vector3.new(0.25,1,1.1)
  1835. weld(slide2,slideside4,cfn(0.09,0,0))
  1836. slideside4.Reflectance=slideReflectance
  1837. slideside4.Material=slideMaterial
  1838.  
  1839. local mgs=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  1840. blo(mgs).Scale=Vector3.new(1.15,0.425,0.245)
  1841. weld(handle,mgs,cfn(0,-0.3,0.125))
  1842.  
  1843. --[[Trigger]]--
  1844. local tp1=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  1845. blo(tp1).Scale=Vector3.new(0.6,0.1,0.8)
  1846. weld(framepiece1,tp1,cfn(0,-0.22,0.13))
  1847.  
  1848. local tp2=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  1849. blo(tp2).Scale=Vector3.new(0.6,0.1,1.19)
  1850. weld(framepiece1,tp2,cfn(0,-0.14,-0.0265)*ang(mr(45),0,0))
  1851.  
  1852. local trigger1=cp(tube,'Really black',Vector3.new(0.2,0.2,0.2))
  1853. blo(trigger1).Scale=Vector3.new(0.3,0.4,0.16)
  1854. weld(framepiece1,trigger1,cfn(0,-0.07,0.09))
  1855.  
  1856. local trigger2=cp(tube,'Really black',Vector3.new(0.2,0.2,0.2))
  1857. blo(trigger2).Scale=Vector3.new(0.3,0.3,0.16)
  1858. weld(trigger1,trigger2,cfn(0,-0.06,-0.015)*ang(mr(30),0,0))
  1859.  
  1860.  
  1861. --[[Magazine]]--
  1862.  
  1863. local magh=cp(tube,'Really black',Vector3.new(0.2,0.5,0.2))
  1864. blo(magh).Scale=Vector3.new(0.6,1,1)
  1865. local magweld=weld(handle,magh,cfn(0,-0.025,0))
  1866.  
  1867. local bottom=cp(tube,'Really black',Vector3.new(0.2,0.2,0.3))
  1868. blo(bottom).Scale=Vector3.new(1.15,0.385,0.8)
  1869. bottomweld=weld(magh,bottom,cfn(0,-0.28,-0.015))
  1870.  
  1871. if highCapMag then
  1872. magweld:Destroy()
  1873. magh.Size=Vector3.new(0.2,0.7,0.2)
  1874. magweld=weld(handle,magh,cfn(0,-0.125,0))
  1875. bottomweld:Destroy()
  1876. bottomweld=weld(magh,bottom,cfn(0,-0.38,-0.015))
  1877. magCapacity=magCapacity+23
  1878. magAmmo=magAmmo+23
  1879. end
  1880.  
  1881. --[[Sights]]--
  1882. local backsight1=cp(tube,'Black',Vector3.new(0.2,0.2,0.2))
  1883. blo(backsight1).Scale=Vector3.new(0.3,0.3,0.3)
  1884. weld(slide1,backsight1,cfn(0.06,0.1,0.13))
  1885. local backsight2=cp(tube,'Black',Vector3.new(0.2,0.2,0.2))
  1886. blo(backsight2).Scale=Vector3.new(0.3,0.3,0.3)
  1887. weld(slide1,backsight2,cfn(-0.06,0.1,0.13))
  1888.  
  1889. local frontsight=cp(tube,'Black',Vector3.new(0.2,0.2,0.2))
  1890. blo(frontsight).Scale=Vector3.new(0.3,0.3,0.3)
  1891. weld(slide1,frontsight,cfn(0,0.1,-0.85))
  1892.  
  1893. local dot1=cp(tube,'Lime green',Vector3.new(0.2,0.2,0.2))
  1894. cyl(dot1).Scale=Vector3.new(0.1,0.31,0.1)
  1895. weld(backsight1,dot1,cfn(0,0.014,0)*ang(mr(-90),0,0))
  1896.  
  1897. local dot2=cp(tube,'Lime green',Vector3.new(0.2,0.2,0.2))
  1898. cyl(dot2).Scale=Vector3.new(0.1,0.31,0.1)
  1899. weld(backsight2,dot2,cfn(0,0.014,0)*ang(mr(-90),0,0))
  1900.  
  1901. local dot3=cp(tube,'Lime green',Vector3.new(0.2,0.2,0.2))
  1902. cyl(dot3).Scale=Vector3.new(0.1,0.31,0.1)
  1903. weld(frontsight,dot3,cfn(0,0.014,0)*ang(mr(-90),0,0))
  1904.  
  1905. local ba=cp(tube,secondaryColor,Vector3.new(0.2,0.2,0.2))
  1906. blo(ba).Scale=Vector3.new(1.15,0.5,1)
  1907. weld(framepiece1,ba,cfn(0,0,-0.55))
  1908. ba.Reflectance=slideReflectance
  1909. ba.Material=slideMaterial
  1910.  
  1911. local weirdholethatpistolshave=cp(tube,'Really black', Vector3.new(0.2,0.2,0.2))
  1912. cyl(weirdholethatpistolshave).Scale=Vector3.new(0.4,1.01,0.4)
  1913. weld(ba,weirdholethatpistolshave,cfn(0,0,0)*ang(mr(-90),0,0))
  1914.  
  1915. --[[Tactical Rails]]--
  1916.  
  1917. local r1=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  1918. blo(r1).Scale=Vector3.new(1.15,0.2,0.25)
  1919. weld(framepiece1,r1,cfn(0,-0.05,-0.17))
  1920.  
  1921. local r2=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  1922. blo(r2).Scale=Vector3.new(1.15,0.2,0.25)
  1923. weld(framepiece1,r2,cfn(0,-0.05,-0.27))
  1924.  
  1925. local r3=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  1926. blo(r3).Scale=Vector3.new(1.15,0.2,0.25)
  1927. weld(framepiece1,r3,cfn(0,-0.05,-0.37))
  1928.  
  1929. if laser then
  1930. local base=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.3))
  1931. blo(base).Scale=Vector3.new(1.15,1,1)
  1932. weld(r2,base,cfn(0,-0.05,0))
  1933. basehole=cp(tube,'White',Vector3.new(0.2,0.2,0.2))
  1934. cyl(basehole).Scale=Vector3.new(0.4,0.4,0.4)
  1935. weld(base,basehole,cfn(0,0,-0.13)*ang(mr(-90),0,0))
  1936. end
  1937.  
  1938. if silencer then
  1939. local sil=cp(tube,'Really black',Vector3.new(0.2,0.3,0.2))
  1940. fireSound.SoundId='rbxassetid://153230595'
  1941. fireSound.Pitch=1
  1942. cyl(sil).Scale=Vector3.new(0.94,1.8,0.94)
  1943. weld(hole,sil,cfn(0,0.29,0))
  1944. end
  1945.  
  1946. if grip then
  1947. local base=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.3))
  1948. blo(base).Scale=Vector3.new(1.15,1,1)
  1949. weld(r2,base,cfn(0,-0.05,0))
  1950. local hd=cp(tube,primaryColor,Vector3.new(0.2,0.6,0.2))
  1951. cyl(hd)
  1952. weld(base,hd,cfn(0,-0.3,0))
  1953. crosshairSpread=3
  1954. spreadint=spreadint-0.3
  1955. end
  1956.  
  1957. --[[Test Functions]]--
  1958.  
  1959. local debounce=false
  1960. local out=false
  1961. local bs=false
  1962. cockSlide=function() -- hahaha yes i know
  1963. slideBackSound:Play()
  1964. if magAmmo<1 and out==true and bs==false then
  1965. wait()
  1966. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  1967. else
  1968. for i=1,2 do
  1969. wait()
  1970. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  1971. end
  1972. end
  1973. local ajar=false
  1974. if magAmmo==1 then
  1975. ajar=true
  1976. end
  1977. if magAmmo>0 then
  1978. createShell()
  1979. --magAmmo=magAmmo-1
  1980. ammocounter.Text=''
  1981. for i=1,magAmmo do
  1982. ammocounter.Text=ammocounter.Text .. 'I'
  1983. end
  1984. end
  1985. wait(0.15)
  1986. slideForwardSound:Play()
  1987. for i=1,2 do
  1988. wait()
  1989. slideweld1.C0=slideweld1.C0*cfn(0,0,-0.22)
  1990. end
  1991. if ajar==true then
  1992. out=true
  1993. slideweld1.C0=cfn(0,0.15,0.23)
  1994. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  1995. end
  1996. end
  1997.  
  1998. --fx
  1999. local firefx=cp(tube,'Neon orange',Vector3.new(0.7,1.1,0.7))
  2000. firefx.Transparency=1
  2001. local mesh=Instance.new('SpecialMesh',firefx)
  2002. mesh.MeshType='Sphere'
  2003. firefx.Material='Neon'
  2004. weld(hole,firefx,cfn(0,1,0))
  2005.  
  2006. local smokefx=Instance.new('Smoke',hole)
  2007. smokefx.Enabled=false
  2008. barrel.CanCollide=true
  2009.  
  2010.  
  2011.  
  2012.  
  2013. local oc = oc or function(...) return ... end
  2014.  
  2015. function ragJoint(hit,r,d)
  2016. Spawn(oc(function()
  2017. d = d or 0
  2018. local rpar,r0,r1 = r.Parent,r.Part0,r.Part1
  2019. if d > 0 then wait(d) end
  2020. local p = hit:Clone()
  2021. p:BreakJoints()
  2022. p:ClearAllChildren()
  2023. p.FormFactor = "Custom"
  2024. p.Size = p.Size/2
  2025. p.Transparency = 1
  2026. p.CanCollide = true
  2027. p.Name = "Colliduh"
  2028. p.Parent = hit
  2029. local w = Instance.new("Weld",p)
  2030. w.Part0 = hit
  2031. w.Part1 = p
  2032. w.C0 = CFrame.new(0,-p.Size.Y/2,0)
  2033. local rot = Instance.new("Rotate",rpar)
  2034. rot.Name = r.Name
  2035. rot.Part0 = r0
  2036. rot.Part1 = r1
  2037. rot.C0 = r.C0
  2038. rot.C1 = r.C1
  2039. r0.Velocity = Vector3.new()
  2040. r1.Velocity = Vector3.new()
  2041. r:Destroy()
  2042. end))
  2043. end
  2044.  
  2045.  
  2046. createShell=function()
  2047. local shell=cp(tube,'Deep orange',Vector3.new(0.2,0.3,0.2))
  2048. shell.CanCollide=true
  2049. shell.Reflectance=0.3
  2050. cyl(shell)
  2051. shell.CFrame=barrel.CFrame*ang(mr(-90),0,0)
  2052. magAmmo=magAmmo-1
  2053. ammocounter.Text=''
  2054. for i=1,magAmmo do
  2055. ammocounter.Text=ammocounter.Text .. 'I'
  2056. end
  2057. game.Debris:AddItem(shell,3)
  2058. end
  2059.  
  2060. reloadPistol=function()
  2061. local current=magAmmo
  2062. Tween(lw,cfn())
  2063. Tween(rw,cfn()*ang(mr(-102),0,0))
  2064. wait(0.4)
  2065. releaseSound:Play()
  2066. bottom.Transparency=1
  2067. magh.Transparency=1
  2068. local mag1=magh:clone()
  2069. mag1.Transparency=0
  2070. mag1.Weld:Destroy''
  2071. local mag2=bottom:clone()
  2072. mag2.Transparency=0
  2073. mag1:BreakJoints''
  2074. mag2:BreakJoints''
  2075. local bm1=mag1:clone()
  2076. local bm2=mag2:clone()
  2077. mag1.Parent=tube
  2078. mag2.Parent=tube
  2079. mag1.CFrame=magh.CFrame
  2080. weld(mag1,mag2,cfn(0,-0.28,-0.015))
  2081. magAmmo=0
  2082. ammocounter.Text=''
  2083. for i=1,magAmmo do
  2084. ammocounter.Text=ammocounter.Text .. 'I'
  2085. end
  2086. wait()
  2087. mag1.CanCollide=true
  2088. mag2.CanCollide=true
  2089. game.Debris:AddItem(mag1,2)
  2090. game.Debris:AddItem(mag2,2)
  2091. wait(0.1)
  2092. Tween(lw,cfn()*ang(mr(25),0,0))
  2093. bm1.Parent=tube
  2094. bm2.Parent=tube
  2095. weld(bm1,bm2,cfn(0,-0.28,-0.015))
  2096. local fa=weld(ch['Left Arm'],bm1,cfn(0,-1.1,0)*ang(mr(-90),0,0))
  2097. wait(0.1)
  2098. Tween(lw,cfn(0,1.4,0)*ang(mr(-109),mr(60),mr(10)),0.07)
  2099. wait(0.25)
  2100. magazinelockSound:Play()
  2101. wait()
  2102. -- reloadSound:Play()
  2103. fa:Destroy''
  2104. bm1:Destroy''
  2105. bm2:Destroy''
  2106. bottom.Transparency=0
  2107. magh.Transparency=0
  2108. local totalcap=0
  2109. if current<1 then --none in chamber reload
  2110. --slideweld1.C0=cfn(0,0,0.45)
  2111. Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0))
  2112. Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(35),0))
  2113. wait(0.1)
  2114. spawn(function()
  2115. cockSlide()
  2116. end)
  2117. Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(55),0))
  2118. wait(0.3)
  2119. totalcap=magCapacity
  2120. else
  2121. totalcap=magCapacity+1
  2122. end
  2123. magAmmo=totalcap
  2124. out=false
  2125. ammocounter.Text=''
  2126. for i=1,magAmmo do
  2127. ammocounter.Text=ammocounter.Text .. 'I'
  2128. end
  2129. restorePosition()
  2130. end
  2131.  
  2132. firePistol=function()
  2133. switchIco(currentIco+crosshairSpread)
  2134. if not jammed and not out then
  2135. spread=spread+spreadint
  2136. end
  2137. print(spread)
  2138. fireSound.Pitch=math.random(math.random(fireSound.Pitch-0.2,fireSound.Pitch-0.1),math.random(fireSound.Pitch,fireSound.Pitch+0.1))
  2139. if magAmmo>0 and jammed==false then
  2140. local ajar=false
  2141. if magAmmo==1 then
  2142. ajar=true
  2143. end
  2144. user=ch
  2145. 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)
  2146. local hit, position = game.Workspace:FindPartOnRay(ray, user)
  2147. if hit then
  2148. if hit.Transparency>0.285 and hit:GetMass()<3000 and hit.Parent.className~='Hat' then
  2149. local temps=glassBreakSound:clone()
  2150. temps.Parent=hit
  2151. temps.Pitch=math.random(math.random(temps.Pitch-0.2,temps.Pitch-0.1),math.random(temps.Pitch,temps.Pitch+0.1))
  2152. temps:Play''
  2153. start_fragmentation(position,.25)
  2154. end
  2155. if tostring(hit.Material)=='Enum.Material.Wood' and hit.Transparency<0.05 then
  2156. local temps=woodImpact:clone()
  2157. temps.Volume=1
  2158. temps.Pitch=math.random(math.random(temps.Pitch-0.2,temps.Pitch-0.1),math.random(temps.Pitch,temps.Pitch+0.1))
  2159. temps.Parent=hit
  2160. temps:Play''
  2161. start_fragmentation(position,.15)
  2162. end
  2163. ypcall(function()
  2164. if hit and hit.Parent and hit.Parent:findFirstChild'Humanoid' then
  2165. local temps=fleshImpact:clone()
  2166. temps.Parent=hit
  2167. temps:Play()
  2168. if hit.Name~='Head' then
  2169. if pAmmunition==true then
  2170. hit.Parent.Humanoid:TakeDamage(math.random(30,65))
  2171. else
  2172. hit.Parent.Humanoid:TakeDamage(math.random(10,24))
  2173. end
  2174. local guy=hit.Parent
  2175. if guy.Name~='TheDarkRevenant' then
  2176. for i,v in pairs(guy:GetChildren()) do
  2177. if v.className=='Hat' then
  2178. v.Handle:BreakJoints()
  2179. end
  2180. local r = guy.Torso:FindFirstChild(v.Name:gsub("Arm","Shoulder"):gsub("Leg","Hip"))
  2181. if v:IsA("BasePart") and r then
  2182. ragJoint(v,r,.1)
  2183. elseif v:IsA("Humanoid") then
  2184. spawn(function()
  2185. wait(0.5)
  2186. v.PlatformStand = true
  2187. v.Changed:connect(function()
  2188. v.PlatformStand = true
  2189. end)
  2190. end)
  2191. end
  2192. end
  2193. end
  2194.  
  2195. else
  2196. if hit.Parent.Name~='TheDarkRevenant' then
  2197. hit.Parent:BreakJoints()
  2198. end
  2199. end
  2200. end
  2201.  
  2202. if hit.Parent.className=='Hat' then
  2203. hit.CanCollide=true
  2204. hit:BreakJoints()
  2205. hit.Velocity=m.Hit.p*5
  2206. end
  2207. end)
  2208. end
  2209. if m.Target then
  2210. local p = Instance.new("Part")
  2211. p.formFactor = "Custom"
  2212. p.Size = Vector3.new(0.5,0.5,0.5)
  2213. p.Transparency = 1
  2214. p.CanCollide = false
  2215. p.Locked = true
  2216. p.CFrame = CFrame.new(position.x,position.y,position.z)--mouse.Target.CFrame+(mouse.Hit.p-mouse.Target.Position)
  2217. local w = Instance.new("Weld")
  2218. w.Part0 = mouse.Target
  2219. w.Part1 = p
  2220. w.C0 = mouse.Target.CFrame:inverse()
  2221. w.C1 = p.CFrame:inverse()
  2222. w.Parent = p
  2223. local d = Instance.new("Decal")
  2224. d.Parent = p
  2225. d.Face = mouse.TargetSurface
  2226. d.Texture = 'rbxassetid://' .. tostring(bulletholes[math.random(#bulletholes)]-2)
  2227. p.Parent = tube
  2228. game.Debris:AddItem(p,6)
  2229. end
  2230. if recoil==true then
  2231. cam:SetRoll(math.random(-2,2))
  2232. cam:TiltUnits(0.501)
  2233. end
  2234. local th=cp(tube,"Really black",Vector3.new(1,1,1))
  2235. th.CanCollide=false
  2236. th.Anchored=true
  2237. th.CFrame=CFrame.new(position.x,position.y,position.z)
  2238. local spm=Instance.new('SpecialMesh',th)
  2239. spm.MeshType='Sphere'
  2240. spm.Scale=Vector3.new(0.05,0.05,0.05)
  2241. spawn(function()
  2242. for i=1,5 do
  2243. wait()
  2244. spm.Scale=spm.Scale+Vector3.new(0.16,0.16,0.16)
  2245. th.Transparency=th.Transparency+0.2
  2246. end
  2247. th:Destroy()
  2248. end)
  2249. fireSound:Play()
  2250. spawn(function()
  2251. firefx.Transparency=0
  2252. wait()
  2253. firefx.Transparency=1
  2254. end)
  2255. spawn(function()
  2256. flash.Enabled=true
  2257. for i=1,2 do
  2258. wait()
  2259. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  2260. end
  2261. flash.Enabled=false
  2262. createShell()
  2263. for i=1,2 do
  2264. wait()
  2265. slideweld1.C0=slideweld1.C0*cfn(0,0,-0.22)
  2266. end
  2267. slideweld1.C0=cfn(0,0.15,0.23)
  2268. if ajar==true then
  2269. out=true
  2270. slideweld1.C0=cfn(0,0.15,0.23)
  2271. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  2272. end
  2273. end)
  2274. ammocounter.Text=''
  2275. for i=1,magAmmo do
  2276. ammocounter.Text=ammocounter.Text .. 'I'
  2277. end
  2278. wait()
  2279. Tween(rw,cfn(0,0.7,0)*ang(mr(-100),mr(-30),0),0.62)
  2280. if not grip then
  2281. Tween(lw,cfn(0,0.7,0)*ang(mr(-100),mr(30),0),0.62)
  2282. else
  2283. Tween(lw,cfn(0,1.3,0)*ang(mr(-100),mr(30),0),0.62)
  2284. end
  2285. wait(0.065)
  2286. restorePosition(0.3)
  2287. else
  2288. if magAmmo<1 then
  2289. slideweld1.C0=cfn(0,0.15,0.23)
  2290. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  2291. end
  2292. emptySound:Play()
  2293. end
  2294. if math.random(jamRate)==jamRate and magAmmo>0 then
  2295. jammed=true
  2296. end
  2297. end
  2298.  
  2299. debounced=function()
  2300. if sheathed==false and debounce==false then
  2301. return true
  2302. end
  2303. end
  2304.  
  2305. mouse.Button1Down:connect(function()
  2306. if debounced() then
  2307. if automatic==false then
  2308. debounce=true
  2309. firePistol()
  2310. debounce=false
  2311. else
  2312. heldDown=true
  2313. firePistol()
  2314. end
  2315. end
  2316. end)
  2317.  
  2318. mouse.Button1Up:connect(function()
  2319. heldDown=false
  2320. end)
  2321.  
  2322. sheathGun=function()
  2323. ammocounter.Visible=false
  2324. if laser then
  2325. laserEnabled=false
  2326. aLaser.Transparency=1
  2327. end
  2328. Tween(rw,cfn())
  2329. Tween(lw,cfn())
  2330. wait(0.1)
  2331. mw:Destroy''
  2332. mw=nil
  2333. mw=weld(tor,handle,cfn(1.11,-1.09,0)*ang(mr(-111.5),0,0))
  2334. labr:Destroy()
  2335. rabr:Destroy()
  2336. bg.maxTorque=Vector3.new()
  2337. sheathed=true
  2338. end
  2339.  
  2340. unsheathGun=function()
  2341. ammocounter.Visible=true
  2342. mw:Destroy''
  2343. mw=nil
  2344. initializeJoints()
  2345. 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)))
  2346. restorePosition()
  2347. bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  2348. sheathed=false
  2349. end
  2350.  
  2351. laserEnabled=false
  2352.  
  2353. mouse.KeyDown:connect(function(key)
  2354. if key=='r' and debounced() then
  2355. debounce=true
  2356. reloadPistol()
  2357. debounce=false
  2358. elseif key=='f' and debounced() then
  2359. debounce=true
  2360. bs=true
  2361. Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0))
  2362. Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(35),0))
  2363. wait(0.1)
  2364. spawn(function()
  2365. cockSlide()
  2366. end)
  2367. Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(55),0))
  2368. wait(0.3)
  2369. jammed=false
  2370. restorePosition()
  2371. bs=false
  2372. debounce=false
  2373. elseif key=='l' and debounced() then
  2374. if not laserEnabled then
  2375. laserEnabled=true
  2376. aLaser.Transparency=0.35
  2377. else
  2378. laserEnabled=false
  2379. aLaser.Transparency=1
  2380. end
  2381. end
  2382. end)
  2383.  
  2384. restorePosition=function(speed)
  2385. if not grip then
  2386. Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0),speed)
  2387. Tween(lw,cfn(0,0.7,0)*ang(mr(-90),mr(30),0),speed)
  2388. else
  2389. Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0),speed)
  2390. Tween(lw,cfn(0,1.3,0)*ang(mr(-90),mr(30),0),speed)
  2391. end
  2392. end
  2393.  
  2394. hopper.Selected:connect(function()
  2395. unsheathGun()
  2396. end)
  2397.  
  2398. hopper.Deselected:connect(function()
  2399. sheathGun()
  2400. end)
  2401.  
  2402. game:service'RunService'.RenderStepped:connect(function()
  2403. bg.cframe = CFrame.new(rootpart.Position,mouse.Hit.p*Vector3.new(1,0,1)+rootpart.Position*Vector3.new(0,1,0))
  2404. if laserEnabled==true then
  2405. local user=ch
  2406. local ray = Ray.new(hole.CFrame.p, (m.Hit.p - hole.CFrame.p).unit*300)
  2407. local hit, position = game.Workspace:FindPartOnRay(ray, user)
  2408. local distance = (position - basehole.CFrame.p).magnitude
  2409. aLaser.Size=Vector3.new(0.2,distance,0.2)
  2410. aLaser.CFrame=CFrame.new(position, basehole.CFrame.p) * CFrame.new(0, 0, -distance/2) * ang(mr(-90),0,0)
  2411. end
  2412. for _,v in pairs(tweenTable) do
  2413. if v.Weld.C1==v.Stop then
  2414. table.remove(tweenTable,_)
  2415. else
  2416. if v.th<0.9 then
  2417. v.th=v.th+v.Step
  2418. i=v.th
  2419. v.Weld.C1 = CFrame.new( (v.Start.p.X * (1 - i)) + (v.Stop.p.X * i),
  2420. (v.Start.p.Y * (1 - i)) + (v.Stop.p.Y * i),
  2421. (v.Start.p.Z * (1 - i)) + (v.Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ(
  2422. (v.X1 * (1 - i)) + (v.X2 * i), (v.Y1 * (1 - i)) + (v.Y2 * i),
  2423. (v.Z1 * (1 - i)) + (v.Z2 * i) )
  2424. else
  2425. v.Weld.C1 = v.Stop
  2426. end
  2427. end
  2428. end
  2429. end)
  2430. for i=1,magAmmo do
  2431. ammocounter.Text=ammocounter.Text .. 'I'
  2432. end
  2433.  
  2434. sheathGun()
  2435.  
  2436. spawn(function()
  2437. while wait(0.07) do
  2438. if heldDown==true then
  2439. spawn(function()
  2440. firePistol()
  2441. end)
  2442. end
  2443. end
  2444. end)
  2445. m.TargetFilter=tube
  2446.  
  2447. while wait(0.03) do
  2448. if spread>1 then
  2449. spread=spread-spreadint/4
  2450. end
  2451. if spread<1 then
  2452. spread=1
  2453. end
  2454. if currentIco>2 then
  2455. switchIco(currentIco-1)
  2456. end
  2457. end
  2458.  
  2459. --hl/https://httpget-inumeration.c9.io/mp45.lua
  2460. --local/game.Players.Conmiro:Destroy''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement