Guest User

Gun Script

a guest
Sep 20th, 2014
3,811
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 35.65 KB | None | 0 0
  1. Tool = script.Parent;
  2. debounce = false
  3. ammotype = script.Parent.Stats.AmmoType.Value
  4. damage = script.Parent.Stats.Damage.Value
  5. a = script.Parent.Stats.Accuracy.Value
  6. b = script.Parent.Stats.Accuracy.Zoomed.Value
  7. o = script.Parent.Stats.Offset.Value
  8. action = script.Parent.Stats.Action
  9. r = script.Parent.Stats.Recoil.Value
  10. mag = script.Parent.Magazine
  11. mag1 = mag:findFirstChild("mag1")
  12. mag2 = mag:findFirstChild("mag2")
  13. mag3 = mag:findFirstChild("mag3")
  14. leftdown = false
  15. activated = false
  16. local shotsfired = 0
  17. local player = game.Players.LocalPlayer
  18. local camera = game.Workspace.CurrentCamera
  19. local camvector = nil
  20. local torso = player.Character.Torso
  21. local r1 = 0
  22. local r2 = 0
  23. local rightweld = nil
  24. local leftweld = nil
  25. local switching = false
  26. local firstlock = false
  27. local recoiled = false
  28. local rX = 0
  29. local rY = 0
  30. local rZ = 0
  31. local gunmarker = nil
  32.  
  33. local arms = nil
  34. local welds = {}
  35.  
  36. local sposl = Vector3.new(0.81, -0.68, -0.03)
  37. local sanglel = Vector3.new(math.rad(0), math.rad(0), math.rad(-50))
  38. local sposr = Vector3.new(-1, 0.6, -1.1)
  39. local sangler = Vector3.new(math.rad(-90), math.rad(-0), math.rad(0))
  40.  
  41. local pposl = Vector3.new(1.15, -0.06, -0.03)
  42. local panglel = Vector3.new(math.rad(0), math.rad(0), math.rad(-50))
  43. local pposr = Vector3.new(-0.8, 0.05, -1.1)
  44. local pangler = Vector3.new(math.rad(-90), math.rad(-5), math.rad(0))
  45.  
  46. local adsposl = Vector3.new(0.5, -0.6, -0.05)
  47. local adsanglel = Vector3.new(math.rad(0), math.rad(0), math.rad(-30))
  48. local adsposr = Vector3.new(0, 0.8, -1.06)
  49. local adsangler = Vector3.new(math.rad(-90), math.rad(0), math.rad(0))
  50.  
  51. if script.Parent:FindFirstChild("primarymarker") then
  52.     gunmarker = script.Parent.primarymarker
  53.     weldposl = pposl
  54.     weldanglel = panglel
  55.     weldposr = pposr
  56.     weldangler = pangler
  57. elseif script.Parent:FindFirstChild("secondarymarker") then
  58.     gunmarker = script.Parent.secondarymarker
  59.     weldposl = sposl
  60.     weldanglel = sanglel
  61.     weldposr = sposr
  62.     weldangler = sangler
  63. end
  64.  
  65. function FindIgnorance()
  66.     local kingme = {}
  67.     table.insert(kingme, player.Character)
  68.     local totes = game.Workspace.Vehicles:GetChildren()
  69.     for ily = 1, #totes do
  70.         if totes[ily]:FindFirstChild("Windows",true) then
  71.             local yum = totes[ily]:FindFirstChild("Windows",true):GetChildren()
  72.             for my = 1, #yum do
  73.                 if yum[my].className == "Part" then
  74.                     if yum[my].Transparency == 1 then
  75.                         table.insert(kingme,yum[my])
  76.                     end
  77.                 end
  78.             end
  79.         end
  80.     end
  81.     local button = game.Workspace:GetChildren()
  82.     for pop = 1, #button do
  83.         if button[pop]:FindFirstChild("Shooter",true) then
  84.             table.insert(kingme,button[pop]:FindFirstChild("Shooter",true).Parent)
  85.         end
  86.         if button[pop]:FindFirstChild("Backpack") then
  87.             table.insert(kingme,button[pop]:FindFirstChild("Backpack"))
  88.         end
  89.     end
  90. return kingme end
  91.  
  92. function WeldArms()
  93.     wait()
  94.     arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
  95.     if arms and torso then
  96.         local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  97.         if sh then
  98.             local yes = true
  99.             if yes then
  100.                 yes = false
  101.                 sh[1].Part1 = nil
  102.                 sh[2].Part1 = nil
  103.                 local weld1 = Instance.new("Weld")
  104.                 weld1.Part0 = arms[2]
  105.                 weld1.Parent = torso
  106.                 weld1.Part1 = arms[1]
  107.                 weld1.C1 = CFrame.new(weldposl) * CFrame.Angles(weldanglel.x,weldanglel.y,weldanglel.z)
  108.                 welds[1] = weld1
  109.                 local weld2 = Instance.new("Weld")
  110.                 weld2.Part0 = Tool.Parent.Head
  111.                 weld2.Parent = torso
  112.                 weld2.Part1 = arms[2]
  113.                 weld2.C1 = CFrame.new(weldposr) * CFrame.Angles(weldangler.x,weldangler.y,weldangler.z)
  114.                 welds[2] = weld2
  115.             end
  116.         end
  117.     end
  118. end
  119.  
  120. function RemoveWelds()
  121.     if arms and torso then
  122.         local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  123.         if sh then
  124.         local yes = true
  125.             if yes then
  126.                 yes = false
  127.                 sh[1].Part1 = arms[1]
  128.                 sh[2].Part1 = arms[2]
  129.                 welds[1].Parent = nil
  130.                 welds[2].Parent = nil
  131.             end
  132.         end
  133.     end
  134. end
  135.  
  136. function Weld(x,y)
  137.     local W = Instance.new("Weld")
  138.     W.Part0 = x
  139.     W.Part1 = y
  140.     local CJ = CFrame.new(x.Position)
  141.     local C0 = x.CFrame:inverse()*CJ
  142.     local C1 = y.CFrame:inverse()*CJ
  143.     W.C0 = C0
  144.     W.C1 = C1
  145.     W.Parent = x
  146. end
  147.  
  148. function Get(A)
  149.     if A.className == "Part" then
  150.         Weld(script.Parent.Handle, A)
  151.         A.Anchored = false
  152.     else
  153.         local C = A:GetChildren()
  154.         for i=1, #C do
  155.             Get(C[i])
  156.         end
  157.     end
  158. end
  159.  
  160. function Finale()
  161.     Get(script.Parent)
  162. end
  163.  
  164. function findWelds()
  165.     local lewelds = player.Character.Torso:GetChildren()
  166.     leftweld = nil
  167.     rightweld = nil
  168.     for i = 1, #lewelds do
  169.         if lewelds[i].className == "Weld" then
  170.             if lewelds[i].Part1 == player.Character:findFirstChild("Left Arm") then
  171.                 leftweld = lewelds[i]
  172.             end
  173.             if lewelds[i].Part1 == player.Character:findFirstChild("Right Arm") then
  174.                 rightweld = lewelds[i]
  175.             end
  176.         end
  177.     end
  178. end
  179.  
  180. function fire(unit)
  181.     local character = Tool.Parent
  182.     ammo = mag.Value
  183.     if ammo and ammo.Parent and not debounce then
  184.         debounce = true
  185.         if tonumber((string.sub(ammo.Parent.Value,2,2) .. string.sub(ammo.Parent.Value,4))) > 0 then
  186.             player.playerstats.vanitystats.bullets.Value = player.playerstats.vanitystats.bullets.Value + 1
  187.             character.Humanoid.WalkSpeed = 9
  188.             local hit,position = nil
  189.             local ignoreparts = FindIgnorance()
  190.             local lefactor = 1
  191.             local mefactor = 1
  192.             if player.Backpack.GlobalFunctions.crouching.Value then
  193.                 lefactor = 0.9
  194.                 mefactor = 0.7
  195.             end
  196.             if Tool.Handle.Fire.Pitch < 4 then
  197.                 local flash = game.Lighting.Flash:clone()
  198.                 flash.Parent = script.Parent.Handle
  199.             end
  200.             if firstlock and not switching then
  201.                 local shootray = Ray.new(character.Head.Position, (unit*(600)+Vector3.new(math.random(-b,b),math.random(-b,b),math.random(-b,b))*mefactor))
  202.                 hit,position = game.Workspace:FindPartOnRayWithIgnoreList(shootray, ignoreparts)
  203.             else
  204.                 local shootray = Ray.new(character.Head.Position, (unit*(600)+Vector3.new(math.random(-a,a),math.random(-a,a),math.random(-a,a))*lefactor))
  205.                 hit,position = game.Workspace:FindPartOnRayWithIgnoreList(shootray, ignoreparts)
  206.             end
  207.             local hop,pop = game.Workspace:FindPartOnRayWithIgnoreList(Ray.new(character.Head.Position, (unit*600)), ignoreparts)
  208.             if hop then
  209.                 local humanoid = hop.Parent:findFirstChild("Humanoid")
  210.                 if not humanoid and hop.Parent ~= game.Workspace then
  211.                     humanoid = hop.Parent.Parent:findFirstChild("Humanoid")
  212.                 end
  213.                 if not humanoid and hop.Parent ~= game.Workspace and hop.Parent.Parent ~= game.Workspace then
  214.                     humanoid = hop.Parent.Parent.Parent:findFirstChild("Humanoid")
  215.                 end
  216.                 if humanoid and game.Players:FindFirstChild(humanoid.Parent.Name) then
  217.                     if humanoid.Parent.pvptag.Value == 0 then
  218.                         player.Character.pvptag.Timer.Value = 30
  219.                         player.Character.pvptag.Value = 1
  220.                     end
  221.                 end
  222.             end
  223.             if hit then
  224.                 local newdamage = damage
  225.                 if hit.Name == "Left Arm" or hit.Name == "Left Leg" or hit.Name == "Right Arm" or hit.Name == "Right Leg" then
  226.                     newdamage = math.ceil(damage*(3/4))
  227.                 elseif hit.Name == "Head" or hit.Parent.Name == "NewHead" or hit.Parent:FindFirstChild("thisishair") then
  228.                     newdamage = math.floor(damage*(3/2))
  229.                     if not hit:IsDescendantOf(game.Workspace.Zombies) then
  230.                         player.playerstats.vanitystats.headshots.player.Value = player.playerstats.vanitystats.headshots.player.Value + 1
  231.                     end
  232.                 end
  233.                 if hit.Parent.className ~= "Tool" then
  234.                     if hit.Parent.Name == "Animal" then
  235.                         hit.Parent.Health.Value = 0
  236.                         player.playerstats.vanitystats.animals.Value = player.playerstats.vanitystats.animals.Value + 1
  237.                     end
  238.                     local humanoid = hit.Parent:findFirstChild("Humanoid")
  239.                     if not humanoid and hit.Parent ~= game.Workspace then
  240.                         humanoid = hit.Parent.Parent:findFirstChild("Humanoid")
  241.                     end
  242.                     if not humanoid and hit.Parent ~= game.Workspace and hit.Parent.Parent ~= game.Workspace then
  243.                         humanoid = hit.Parent.Parent.Parent:findFirstChild("Humanoid")
  244.                     end
  245.                     if humanoid then
  246.                         player.playerstats.vanitystats.damage.dealt.Value = player.playerstats.vanitystats.damage.dealt.Value + newdamage
  247.                         blood = game.Lighting.Blood:clone()
  248.                         blood.RemoveScript.Disabled = false
  249.                         blood.Parent = hit
  250.                         if humanoid.Parent.Name == "Zombie" then
  251.                             if humanoid.Health > 0 then
  252.                                 if humanoid.Health <= newdamage then
  253.                                     if humanoid.Parent.Role.Value == "Military" then
  254.                                         player.playerstats.ZombieKill.Military.Value = player.playerstats.ZombieKill.Military.Value + 1
  255.                                     else
  256.                                         player.playerstats.ZombieKill.Civilian.Value = player.playerstats.ZombieKill.Civilian.Value + 1
  257.                                     end
  258.                                     humanoid.Health = 0
  259.                                 elseif hit.Name == "Head" or hit.Name == "Handle" or hit.Name == "Helmet" then
  260.                                     if humanoid.Parent:FindFirstChild("Helmet") then
  261.                                         local fark = math.random(1,32-damage)
  262.                                         if fark >= 1 and fark <= 7 then
  263.                                             player.playerstats.vanitystats.damage.dealt.Value = player.playerstats.vanitystats.damage.dealt.Value + (humanoid.Health - newdamage)
  264.                                             player.playerstats.ZombieKill.Military.Value = player.playerstats.ZombieKill.Military.Value + 1
  265.                                             player.playerstats.vanitystats.headshots.zombie.Value = player.playerstats.vanitystats.headshots.zombie.Value + 1
  266.                                             humanoid.Health = 0
  267.                                         else
  268.                                             blood.Parent = nil
  269.                                             humanoid.Parent:FindFirstChild("Helmet").Handle.Ping:Play()
  270.                                         end
  271.                                     else
  272.                                         if humanoid.Parent.Role.Value == "Military" then
  273.                                             player.playerstats.ZombieKill.Military.Value = player.playerstats.ZombieKill.Military.Value + 1
  274.                                         else
  275.                                             player.playerstats.ZombieKill.Civilian.Value = player.playerstats.ZombieKill.Civilian.Value + 1
  276.                                         end
  277.                                         player.playerstats.vanitystats.damage.dealt.Value = player.playerstats.vanitystats.damage.dealt.Value + (humanoid.Health - newdamage)
  278.                                         player.playerstats.vanitystats.headshots.zombie.Value = player.playerstats.vanitystats.headshots.zombie.Value + 1
  279.                                         humanoid.Health = 0
  280.                                     end
  281.                                 else
  282.                                     humanoid.Health = humanoid.Health - newdamage
  283.                                 end
  284.                             end
  285.                         end
  286.                         if humanoid.Parent.Name ~= "Zombie" then
  287.                             if humanoid:FindFirstChild("Regeneration") then
  288.                                 if humanoid.Health <= newdamage and humanoid.Health > 0 then
  289.                                     local targetcharacter = humanoid.Parent
  290.                                     local prey = game.Players:GetPlayerFromCharacter(targetcharacter)
  291.                                     if prey.playerstats.PlayerKill.Aggressive.Value < 3 then
  292.                                         if targetcharacter.pvptag.Value == 0 then
  293.                                             player.playerstats.PlayerKill.Aggressive.Value = player.playerstats.PlayerKill.Aggressive.Value + 1
  294.                                         elseif targetcharacter.pvptag.Value == 1 then
  295.                                             player.playerstats.PlayerKill.Defensive.Value = player.playerstats.PlayerKill.Defensive.Value + 1
  296.                                         end
  297.                                     elseif prey.playerstats.PlayerKill.Aggressive.Value >= 3 then
  298.                                         player.playerstats.PlayerKill.Bandit.Value = player.playerstats.PlayerKill.Bandit.Value + 1
  299.                                     end
  300.                                 end
  301.                                 lecheck = true
  302.                                 local playergroup = game.Lighting.Groups:findFirstChild(game.Players.LocalPlayer:findFirstChild("MyGroup", true).groupid.Value)
  303.                                 if playergroup then
  304.                                     local gasp = playergroup:GetChildren()
  305.                                     for ha = 1, #gasp do
  306.                                         if gasp[ha].Value == humanoid.Parent.Name then
  307.                                             lecheck = false
  308.                                         end
  309.                                     end
  310.                                 end
  311.                                 if lecheck then
  312.                                     humanoid.Regeneration.Value = true
  313.                                     humanoid.Health = humanoid.Health - newdamage
  314.                                 end
  315.                             else
  316.                                 humanoid.Health = humanoid.Health - newdamage
  317.                             end
  318.                         end
  319.                     else
  320.                         if hit.Transparency == 0 then
  321.                             local bullet = game.Lighting.Bullet:clone()
  322.                             bullet.Position = position
  323.                             if hit:IsDescendantOf(game.Workspace:FindFirstChild("Anchored Objects"):FindFirstChild("Plates")) or hit:IsDescendantOf(game.Workspace:FindFirstChild("Anchored Objects"):FindFirstChild("Trees/Foliage")) then
  324.                                 if game.Lighting:GetMinutesAfterMidnight() > 330 and game.Lighting:GetMinutesAfterMidnight() < 1080 then
  325.                                     bullet.Fire.Color = Color3.new(80/255,60/255,20/255)
  326.                                 else
  327.                                     bullet.Fire.Color = Color3.new(30/255,20/255,10/255)
  328.                                 end
  329.                                 bullet.Fire.Heat = 9
  330.                             end
  331.                             bullet.Parent = game.Workspace
  332.                         end
  333.                     end
  334.                     if hit.Parent ~= game.Workspace then
  335.                         if hit.Parent.Parent ~= game.Workspace then
  336.                             if hit.Parent.Parent.Parent.Name == "VehicleBody" or hit.Parent.Parent.Name == "VehicleBody" or hit.Parent.Name == "VehicleBody" then
  337.                                 if hit.Parent.Parent.Parent.Name == "VehicleBody" then
  338.                                     vehicle = hit.Parent.Parent.Parent
  339.                                 end
  340.                                 if hit.Parent.Parent.Name == "VehicleBody" then
  341.                                     vehicle = hit.Parent.Parent
  342.                                 end
  343.                                 if hit.Parent.Name == "VehicleBody" then
  344.                                     vehicle = hit.Parent
  345.                                 end
  346.                                 vehiclestats = vehicle.Parent.Stats
  347.                                 if hit.Name == "Collider" then
  348.                                     hullratio = vehiclestats.Hull.Value
  349.                                     vehiclestats.Hull.Value = vehiclestats.Hull.Value - math.floor(damage/2)*(hullratio/vehiclestats.Hull.MaxHull.Value)
  350.                                     vehiclestats.Engine.Value = vehiclestats.Engine.Value - math.floor(damage/2)*(1-(hullratio/vehiclestats.Hull.MaxHull.Value))
  351.                                 elseif hit.Name == "RearCollider" then
  352.                                     hullratio = vehiclestats.Hull.Value
  353.                                     vehiclestats.Hull.Value = vehiclestats.Hull.Value - math.floor(damage/2)*(hullratio/vehiclestats.Hull.MaxHull.Value)
  354.                                     vehiclestats.Tank.Value = vehiclestats.Tank.Value - math.floor(damage/2)*(1-(hullratio/vehiclestats.Hull.MaxHull.Value))
  355.                                 elseif hit.Name == "Wheel" then
  356.                                     thewheel = hit.Parent
  357.                                     rugula = math.random(1,5)
  358.                                     if rugula == 1 then
  359.                                         hundr = hit.Parent:GetChildren()
  360.                                         for hurgle = 1, #hundr do
  361.                                             hundr[hurgle].Transparency = 1
  362.                                             hundr[hurgle].CanCollide = false
  363.                                         end
  364.                                     end
  365.                                 else
  366.                                     vehiclestats.Hull.Value = vehiclestats.Hull.Value - math.floor(damage/2)
  367.                                 end
  368.                             end
  369.                         end
  370.                     end
  371.                     if hit then
  372.                         if hit.Name == "Window" then
  373.                             local breaksound = game.Lighting.BreakSound:clone()
  374.                             breaksound.Broken.Value = hit
  375.                             breaksound.Parent = hit
  376.                         elseif hit.Parent.Name == "Window" then
  377.                             local breaksound = game.Lighting.BreakSound:clone()
  378.                             breaksound.Broken.Value = hit.Parent
  379.                             breaksound.Parent = hit
  380.                         elseif hit.Parent.Name == "Windows" then
  381.                             if math.random(1,2) == 1 then
  382.                                 hit.Transparency = 1
  383.                                 local breaksound = game.Lighting.BreakSound:clone()
  384.                                 breaksound.Broken.Value = nil
  385.                                 breaksound.Parent = hit
  386.                             end
  387.                         elseif hit.Parent.Name == "PatientZero" then
  388.                             player.Character.Humanoid.Health = math.ceil(player.Character.Humanoid.Health*0.81)
  389.                             hit.Parent.ShotAt.Value = true
  390.                         end
  391.                     end
  392.                 end
  393.             end
  394.             if firstlock then
  395.                 findWelds()
  396.                 if leftweld and rightweld then
  397.                     addX = (math.random(-2,2)/200)*r/12
  398.                     addZ = (math.random(-2,2)/200)*r/12
  399.                     addY = 0.025*r/12
  400.                     camera.Focus = camera.Focus + Vector3.new(addX, addY, addZ)
  401.                     rX = rX + addX
  402.                     rZ = rZ + addZ
  403.                     rY = rY + addY
  404.                 end
  405.             end
  406.             Tool.Handle.Fire:Play()
  407.             player.Character.Humanoid.Visibility.Shooting.Value = Tool.Handle.Fire.Volume
  408.             local ammoval = tonumber((string.sub(ammo.Parent.Value,2,2) .. string.sub(ammo.Parent.Value,4)))
  409.             ammoval = ammoval - 1
  410.             local rounds = tostring(ammoval)
  411.             if ammoval < 10 then
  412.                 ammo.Parent.Value = "G0X" .. string.sub(rounds,1)
  413.             else
  414.                 ammo.Parent.Value = "G" .. string.sub(rounds,1,1) .. "X" .. string.sub(rounds,2)
  415.             end
  416.         end
  417.         if tonumber((string.sub(ammo.Parent.Value,2,2) .. string.sub(ammo.Parent.Value,4))) <= 0 then
  418.             script.Parent.Reload.Value = 3
  419.             Tool.Handle.Reload:play()
  420.             onDeactivated(mouse)
  421.             wait(script.Parent.Stats.Reload.Value/10)
  422.             ammo.Parent.Parent.Parent.Value = 0
  423.             ammo.Parent.Parent:Destroy()
  424.             FindMag()
  425.         end
  426.         debounce = false
  427.     end
  428. end
  429.  
  430. function check()
  431.     if not Tool.Enabled or script.Parent.Reload.Value > 0 or player.Backpack.GlobalFunctions.sprinting.Value then
  432.         return false
  433.     else
  434.         return true
  435.     end
  436. end
  437.  
  438. Tool.Enabled = true
  439.  
  440. function UpdateAmmo()
  441.     if player.PlayerGui:findFirstChild("AmmoLeft") then
  442.         if player.PlayerGui:findFirstChild("AmmoLeft"):findFirstChild("Shoot") then
  443.             player.PlayerGui:findFirstChild("AmmoLeft"):findFirstChild("Shoot").Value = true
  444.         end
  445.     end
  446. end
  447.  
  448. function onCycle(mouse)
  449.     if not activated then
  450.         activated = true
  451.         local targetPos = mouse.Hit.p
  452.         local dist = (targetPos - player.Character.Head.Position).magnitude
  453.         local lookAt = (targetPos - player.Character.Head.Position).unit
  454.  
  455.         if check() then
  456.             if action.Value == 0 then
  457.                 fire(lookAt)
  458.                 UpdateAmmo()
  459.                 wait(0.1)
  460.             elseif action.Value == 1 then
  461.                 fire(lookAt)
  462.                 UpdateAmmo()
  463.                 wait(60/action.Rate.Value)
  464.                 if leftdown then
  465.                     activated = false
  466.                     onCycle(mouse)
  467.                 end
  468.             elseif action.Value == 2 then
  469.                 fire(lookAt)
  470.                 UpdateAmmo()
  471.                 wait(0.6)
  472.             elseif action.Value == 3 then
  473.                 fire(lookAt)
  474.                 UpdateAmmo()
  475.                 wait(60/action.Rate.Value)
  476.                 shotsfired = shotsfired + 1
  477.                 if shotsfired < 3 then
  478.                     activated = false
  479.                     onCycle(mouse)
  480.                 else
  481.                     shotsfired = 0
  482.                 end
  483.             elseif action.Value == 4 then
  484.                 fire(lookAt)
  485.                 UpdateAmmo()
  486.                 wait(0.6)
  487.             end
  488.             player.Character.Humanoid.WalkSpeed = 16
  489.         end
  490.         activated = false
  491.     end
  492. end
  493.  
  494. function onActivated(mouse)
  495.     leftdown = true
  496.     onCycle(mouse)
  497. end
  498.  
  499. function onDeactivated(mouse)
  500.     leftdown = false
  501.     if not game.Players.LocalPlayer.Backpack.GlobalFunctions.sprinting.Value then
  502.         Tool.Parent.Humanoid.WalkSpeed = 16
  503.     end
  504. end
  505.  
  506. function onMove(mouse)
  507.     local targ = mouse.Target
  508.     local infogui = game.Lighting.Info:clone()
  509.     if not firstlock then
  510.         if targ and player:DistanceFromCharacter(mouse.Target.Position) < 50 then
  511.             if targ.Parent:findFirstChild("Humanoid") and targ.Parent.Name ~= "Zombie" then
  512.                 local oldgui = player.PlayerGui:findFirstChild("Info")
  513.                 if oldgui then oldgui:Destroy() end
  514.                 infogui.Frame.Text.Text = targ.Parent.Name
  515.                 infogui.Frame.Position = UDim2.new(0, ((mouse.X)-80), 0, ((mouse.Y)-20))
  516.                 infogui.Parent = player.PlayerGui
  517.             end
  518.         end
  519.         if targ and player:DistanceFromCharacter(mouse.Target.Position) < 50 then
  520.             if targ.Parent.Parent:findFirstChild("Humanoid") and targ.Parent.Parent.Name ~= "Zombie" then
  521.                 local oldgui = player.PlayerGui:findFirstChild("Info")
  522.                 if oldgui then oldgui:Destroy() end
  523.                 infogui.Frame.Text.Text = targ.Parent.Parent.Name
  524.                 infogui.Frame.Position = UDim2.new(0, ((mouse.X)-80), 0, ((mouse.Y)-20))
  525.                 infogui.Parent = player.PlayerGui
  526.             end
  527.         end
  528.     end
  529.     if targ and not targ.Parent:findFirstChild("Humanoid") and not targ.Parent.Parent:findFirstChild("Humanoid") then
  530.         local oldgui = player.PlayerGui:findFirstChild("Info")
  531.         if oldgui then oldgui:Destroy() end
  532.     end
  533.     if not targ then
  534.         local oldgui = player.PlayerGui:findFirstChild("Info")
  535.         if oldgui then oldgui:Destroy() end
  536.     end
  537. end
  538.  
  539. function onLooking(mouse)
  540.     if firstlock then
  541.         mouse.Icon = "http://www.roblox.com/asset/?id=32935220"
  542.     else
  543.         mouse.Icon = "http://www.roblox.com/asset/?id=105620056"
  544.     end
  545.     if firstlock and not switching then
  546.         if leftweld and rightweld then
  547.             verticalturn = math.asin((mouse.Hit.p - player.Character.Head.Position).unit.y)
  548.             rightweld.C1 = CFrame.new(rightweld.C1.p) * CFrame.Angles(math.rad(-90) - verticalturn,0,0)
  549.             torso.CFrame = CFrame.new(torso.CFrame.p) * CFrame.Angles(0,math.rad(180) + math.atan2((mouse.Hit.p - torso.Position).unit.x,(mouse.Hit.p - torso.Position).unit.z),0)
  550.         end
  551.     end
  552. end
  553.  
  554. function onLookingCheck(mouse)
  555.     if firstlock then
  556.         mouse.Icon = "http://www.roblox.com/asset/?id=32935220"
  557.     else
  558.         mouse.Icon = "http://www.roblox.com/asset/?id=105620056"
  559.     end
  560.     if firstlock and not switching and rY > 0 then
  561.         if leftweld and rightweld then
  562.             verticalturn = math.asin((mouse.Hit.p - player.Character.Head.Position).unit.y)
  563.             rightweld.C1 = CFrame.new(rightweld.C1.p) * CFrame.Angles(math.rad(-90) - verticalturn,0,0)
  564.             torso.CFrame = CFrame.new(torso.CFrame.p) * CFrame.Angles(0,math.rad(180) + math.atan2((mouse.Hit.p - torso.Position).unit.x,(mouse.Hit.p - torso.Position).unit.z),0)
  565.         end
  566.     end
  567. end
  568.  
  569. function onZoomOut(mouse)
  570.     if not firstlock then
  571.         if player.CameraMode ~= "Classic" then
  572.             player.CameraMode = "Classic"
  573.         end
  574.     end
  575. end
  576.  
  577. function FindMag()
  578.     local decisionclip = nil
  579.     local newclip = nil
  580.     local firstammo = mag.Value
  581.     local slots = player.playerstats.slots:GetChildren()
  582.     burstshot = 3
  583.     if firstammo and firstammo.Parent then
  584.         for z = 1, #slots do
  585.             local newclip = slots[z]:findFirstChild(ammotype, true)
  586.             if newclip then
  587.                 local newammoval = tonumber((string.sub(newclip.Parent.Value,2,2) .. string.sub(newclip.Parent.Value,4)))
  588.                 local firstammoval = tonumber((string.sub(firstammo.Parent.Value,2,2) .. string.sub(firstammo.Parent.Value,4)))
  589.                 if decisionclip then
  590.                     local decammoval = tonumber((string.sub(decisionclip.Parent.Value,2,2) .. string.sub(decisionclip.Parent.Value,4)))
  591.                     if newammoval > firstammoval and newammoval > decammoval then
  592.                         decisionclip = newclip
  593.                     end
  594.                 end
  595.                 if not decisionclip then
  596.                     if newammoval > firstammoval then
  597.                         decisionclip = newclip
  598.                     end
  599.                 end
  600.             end
  601.         end
  602.     else
  603.         for z = 1, #slots do
  604.             local newclip = slots[z]:findFirstChild(ammotype, true)
  605.             if newclip then
  606.                 local newammoval = tonumber((string.sub(newclip.Parent.Value,2,2) .. string.sub(newclip.Parent.Value,4)))
  607.                 if decisionclip then
  608.                     local decammoval = tonumber((string.sub(decisionclip.Parent.Value,2,2) .. string.sub(decisionclip.Parent.Value,4)))
  609.                     if newammoval > decammoval then
  610.                         decisionclip = newclip
  611.                     end
  612.                 end
  613.                 if not decisionclip then
  614.                     if newammoval then
  615.                         decisionclip = newclip
  616.                     end
  617.                 end
  618.             end
  619.         end
  620.     end
  621.     if decisionclip then
  622.         mag.Value = decisionclip
  623.     end
  624.     local allmags = script.Parent:GetChildren()
  625.     for ka = 1, #allmags do
  626.         if allmags[ka].className == "Part" and string.sub(allmags[ka].Name,1,3):lower() == "mag" then
  627.             allmags[ka].Transparency = 1
  628.         end
  629.     end
  630.     if not mag.Value or not mag.Value.Parent then
  631.         return
  632.     else
  633.         if mag1 then
  634.             if mag.Value.Parent.Parent.Value == mag1.Value then
  635.                 for lo = 1, #allmags do
  636.                     if allmags[lo].className == "Part" and allmags[lo].Name:lower() == "mag1" then
  637.                         allmags[lo].Transparency = 0
  638.                     end
  639.                 end
  640.             end
  641.         end
  642.         if mag2 then
  643.             if mag.Value.Parent.Parent.Value == mag2.Value then
  644.                 for lo = 1, #allmags do
  645.                     if allmags[lo].className == "Part" and allmags[lo].Name:lower() == "mag2" then
  646.                         allmags[lo].Transparency = 0
  647.                     end
  648.                 end
  649.             end
  650.         end
  651.         if mag3 then
  652.             if mag.Value.Parent.Parent.Value == mag3.Value then
  653.                 for lo = 1, #allmags do
  654.                     if allmags[lo].className == "Part" and allmags[lo].Name:lower() == "mag3" then
  655.                         allmags[lo].Transparency = 0
  656.                     end
  657.                 end
  658.             end
  659.         end
  660.     end
  661. end
  662.  
  663. function onKeyDown(key)
  664.     local character = Tool.Parent
  665.     local decisionclip = nil
  666.     local firstammo = nil
  667.     local newclip = nil
  668.     if (key == "r") and script.Parent.Reload.Value == 0 then
  669.         Tool.Handle.Reload:play()
  670.         script.Parent.Reload.Value = 3
  671.         wait(script.Parent.Stats.Reload.Value/10)
  672.         FindMag()
  673.         if game.Players.LocalPlayer.PlayerGui:findFirstChild("AmmoLeft") then
  674.             game.Players.LocalPlayer.PlayerGui.AmmoLeft.Shoot.Value = true
  675.         end
  676.     end
  677.     if key == "f" and not leftdown then
  678.         if action.Original.Value == 1 then
  679.             if action.Value == 0 then
  680.                 action.Value = 1
  681.             else
  682.                 action.Value = 0
  683.             end
  684.         end
  685.         if action.Original.Value == 3 then
  686.             if action.Value == 0 then
  687.                 if not player.PlayerGui.Inventory.toggles.burstfire.Value then
  688.                     action.Value = 3
  689.                 else
  690.                     action.Value = 1
  691.                 end
  692.             elseif action.Value == 3 then
  693.                 action.Value = 1
  694.             else
  695.                 action.Value = 0
  696.             end
  697.         end
  698.     end
  699.     if key == "l" then
  700.         if script.Parent:FindFirstChild("FlashLight",true) then
  701.             if script.Parent:FindFirstChild("FlashLight",true).Enabled then
  702.                 script.Parent:FindFirstChild("FlashLight",true).Enabled = false
  703.             else
  704.                 script.Parent:FindFirstChild("FlashLight",true).Enabled = true
  705.             end
  706.         end
  707.     end
  708.     if key == "o" and not firstlock then
  709.         player.CameraMode = "Classic"
  710.     end
  711.     if key == player.PlayerGui.Inventory.toggles.aim.Value then
  712.         local wparts = script.Parent:GetChildren()
  713.         for i = 1, #wparts do
  714.             if wparts[i]:FindFirstChild("lenspart") then
  715.                 o = (player.Character.Head.Position.Y - wparts[i].Position.Y - 0.04)
  716.                 if o > 1 then o = script.Parent.Stats.Offset.Value end
  717.             end
  718.         end
  719.         local mouse = player:GetMouse()
  720.         if not firstlock and not switching and player.Character:findFirstChild("Shooter", true) and camera.FieldOfView > 69 and camera.FieldOfView < 71 and not player.Character.Humanoid.Sit then
  721.             switching = true
  722.             camvector = (camera.CoordinateFrame.p - player.Character.Head.Position)
  723.             camera.CameraType = "Track"
  724.             ting = 0
  725.             rightweld = nil
  726.             leftweld = nil
  727.             firstlock = true
  728.             mouse.Icon = "http://www.roblox.com/asset/?id=32935220"
  729.             findWelds()
  730.             repeat
  731.                 if camvector.magnitude > 2 then
  732.                     camera.CoordinateFrame = camera.CoordinateFrame - camvector/6
  733.                 end
  734.                 if leftweld and rightweld then
  735.                     rightweld.C1 = rightweld.C1 * CFrame.Angles((adsangler.x - weldangler.x)/5,(adsangler.y - weldangler.y)/5,(adsangler.z - weldangler.z)/5) + (adsposr - weldposr)/5 + Vector3.new(0,0,o/5)
  736.                     leftweld.C1 = leftweld.C1 * CFrame.Angles((adsanglel.x - weldanglel.x)/5,(adsanglel.y - weldanglel.y)/5,(adsanglel.z - weldanglel.z)/5) + (adsposl - weldposl)/5
  737.                 end
  738.                 camera.FieldOfView = camera.FieldOfView - (5 + gunmarker.Value)
  739.                 ting = ting + 1
  740.                 wait(1/30)
  741.             until ting == 5
  742.             player.CameraMode = "LockFirstPerson"
  743.             if camvector.magnitude > 2 then
  744.                 camera.CoordinateFrame = player.Character.Head.CFrame - player.Character.Head.CFrame.lookVector
  745.             end
  746.             camera.CameraType = "Custom"
  747.             switching = false
  748.             if camvector.magnitude < 2 then
  749.                 onLooking(mouse)
  750.             end
  751.             player.Character.Humanoid.WalkSpeed = 8
  752.             local emma = player.Character.Head:GetChildren()
  753.             for z = 1, #emma do
  754.                 if emma[z].className == "Sound" then
  755.                     if emma[z].SoundId == "rbxasset://sounds/bfsl-minifigfoots1.mp3" then
  756.                         emma[z].Pitch = 0.9
  757.                     end
  758.                 end
  759.             end
  760.         return end
  761.         if firstlock and not switching then
  762.             switching = true
  763.             ting = 0
  764.             camera.CameraType = "Track"
  765.             if camvector.magnitude > 2 then
  766.                 player.CameraMode = "Classic"
  767.             end
  768.             rightweld = nil
  769.             leftweld = nil
  770.             findWelds()
  771.             if leftweld and rightweld then
  772.                 rightweld.C1 = CFrame.new(adsposr) * CFrame.Angles(adsangler.x,adsangler.y,adsangler.z) + Vector3.new(0,0,o)
  773.                 leftweld.C1 = CFrame.new(adsposl) * CFrame.Angles(adsanglel.x,adsanglel.y,adsanglel.z)
  774.             end
  775.             firstlock = false
  776.             repeat
  777.                 if camvector.magnitude > 2 then
  778.                     camera.CoordinateFrame = camera.CoordinateFrame - player.Character.Head.CFrame.lookVector*2 + Vector3.new(0,0.6,0)
  779.                 end
  780.                 if leftweld and rightweld then
  781.                     rightweld.C1 = rightweld.C1 * CFrame.Angles((weldangler.x - adsangler.x)/5,(weldangler.y - adsangler.y)/5,(weldangler.z - adsangler.z)/5) + (weldposr - adsposr)/5 - Vector3.new(0,0,o/5)
  782.                     leftweld.C1 = leftweld.C1 * CFrame.Angles((weldanglel.x - adsanglel.x)/5,(weldanglel.y - adsanglel.y)/5,(weldanglel.z - adsanglel.z)/5) + (weldposl - adsposl)/5
  783.                 end
  784.                 camera.FieldOfView = camera.FieldOfView + (5 + gunmarker.Value)
  785.                 ting = ting + 1
  786.                 wait()
  787.             until ting == 5
  788.             camera.CameraType = "Custom"
  789.             switching = false
  790.             mouse.Icon = "http://www.roblox.com/asset/?id=105620056"
  791.             player.Character.Humanoid.WalkSpeed = 16
  792.             local emma = player.Character.Head:GetChildren()
  793.             for z = 1, #emma do
  794.                 if emma[z].className == "Sound" then
  795.                     if emma[z].SoundId == "rbxasset://sounds/bfsl-minifigfoots1.mp3" then
  796.                         emma[z].Pitch = 1
  797.                     end
  798.                 end
  799.             end
  800.         return end
  801.     end
  802. end
  803.  
  804. function onMouseButton2Down(mouse)
  805.     r1 = game.Workspace.DistributedgameTime
  806.     local wparts = script.Parent:GetChildren()
  807.     for i = 1, #wparts do
  808.         if wparts[i]:FindFirstChild("lenspart") then
  809.             o = (player.Character.Head.Position.Y - wparts[i].Position.Y - 0.04)
  810.             if o > 1 then o = script.Parent.Stats.Offset.Value end
  811.         end
  812.     end
  813. end
  814.  
  815. function onMouseButton2Up(mouse)
  816.     r2 = game.Workspace.DistributedgameTime
  817.     if (r2 - r1) < 0.2 and not player.Backpack.GlobalFunctions.sprinting.Value and player.PlayerGui.Inventory.toggles.aim.Value == "Right Mouse" and not player.Character.Humanoid.Sit then
  818.         if not firstlock and not switching and player.Character:findFirstChild("Shooter", true) and camera.FieldOfView > 69 and camera.FieldOfView < 71 then
  819.             switching = true
  820.             camvector = (camera.CoordinateFrame.p - player.Character.Head.Position)
  821.             camera.CameraType = "Track"
  822.             ting = 0
  823.             rightweld = nil
  824.             leftweld = nil
  825.             firstlock = true
  826.             mouse.Icon = "http://www.roblox.com/asset/?id=32935220"
  827.             findWelds()
  828.             repeat
  829.                 if camvector.magnitude > 2 then
  830.                     camera.CoordinateFrame = camera.CoordinateFrame - camvector/6
  831.                 end
  832.                 if leftweld and rightweld then
  833.                     rightweld.C1 = rightweld.C1 * CFrame.Angles((adsangler.x - weldangler.x)/5,(adsangler.y - weldangler.y)/5,(adsangler.z - weldangler.z)/5) + (adsposr - weldposr)/5 + Vector3.new(0,0,o/5)
  834.                     leftweld.C1 = leftweld.C1 * CFrame.Angles((adsanglel.x - weldanglel.x)/5,(adsanglel.y - weldanglel.y)/5,(adsanglel.z - weldanglel.z)/5) + (adsposl - weldposl)/5
  835.                 end
  836.                 camera.FieldOfView = camera.FieldOfView - (5 + gunmarker.Value)
  837.                 ting = ting + 1
  838.                 wait(1/30)
  839.             until ting == 5
  840.             player.CameraMode = "LockFirstPerson"
  841.             if camvector.magnitude > 2 then
  842.                 camera.CoordinateFrame = player.Character.Head.CFrame - player.Character.Head.CFrame.lookVector
  843.             end
  844.             camera.CameraType = "Custom"
  845.             switching = false
  846.             if camvector.magnitude < 2 then
  847.                 onLooking(mouse)
  848.             end
  849.             player.Character.Humanoid.WalkSpeed = 8
  850.             local emma = player.Character.Head:GetChildren()
  851.             for z = 1, #emma do
  852.                 if emma[z].className == "Sound" then
  853.                     if emma[z].SoundId == "rbxasset://sounds/bfsl-minifigfoots1.mp3" then
  854.                         emma[z].Pitch = 0.9
  855.                     end
  856.                 end
  857.             end
  858.         return end
  859.         if firstlock and not switching then
  860.             switching = true
  861.             ting = 0
  862.             camera.CameraType = "Track"
  863.             if camvector.magnitude > 2 then
  864.                 player.CameraMode = "Classic"
  865.             end
  866.             rightweld = nil
  867.             leftweld = nil
  868.             findWelds()
  869.             if leftweld and rightweld then
  870.                 rightweld.C1 = CFrame.new(adsposr) * CFrame.Angles(adsangler.x,adsangler.y,adsangler.z) + Vector3.new(0,0,o)
  871.                 leftweld.C1 = CFrame.new(adsposl) * CFrame.Angles(adsanglel.x,adsanglel.y,adsanglel.z)
  872.             end
  873.             firstlock = false
  874.             repeat
  875.                 if camvector.magnitude > 2 then
  876.                     camera.CoordinateFrame = camera.CoordinateFrame - player.Character.Head.CFrame.lookVector*2 + Vector3.new(0,0.6,0)
  877.                 end
  878.                 if leftweld and rightweld then
  879.                     rightweld.C1 = rightweld.C1 * CFrame.Angles((weldangler.x - adsangler.x)/5,(weldangler.y - adsangler.y)/5,(weldangler.z - adsangler.z)/5) + (weldposr - adsposr)/5 - Vector3.new(0,0,o/5)
  880.                     leftweld.C1 = leftweld.C1 * CFrame.Angles((weldanglel.x - adsanglel.x)/5,(weldanglel.y - adsanglel.y)/5,(weldanglel.z - adsanglel.z)/5) + (weldposl - adsposl)/5
  881.                 end
  882.                 camera.FieldOfView = camera.FieldOfView + (5 + gunmarker.Value)
  883.                 ting = ting + 1
  884.                 wait()
  885.             until ting == 5
  886.             camera.CameraType = "Custom"
  887.             switching = false
  888.             mouse.Icon = "http://www.roblox.com/asset/?id=105620056"
  889.             player.Character.Humanoid.WalkSpeed = 16
  890.             local emma = player.Character.Head:GetChildren()
  891.             for z = 1, #emma do
  892.                 if emma[z].className == "Sound" then
  893.                     if emma[z].SoundId == "rbxasset://sounds/bfsl-minifigfoots1.mp3" then
  894.                         emma[z].Pitch = 1
  895.                     end
  896.                 end
  897.             end
  898.         return end
  899.     end
  900. end
  901.  
  902. function onEquip(mouse)
  903.     if player.PlayerGui.BicycleHUD.Stats.Visible or player.PlayerGui.VehicleHUD.Stats.Visible or player.PlayerGui.MotorcycleHUD.Stats.Visible or player.Character.Humanoid.Sit then
  904.         player.Character:WaitForChild(script.Parent.Name)
  905.         wait()
  906.         player.Character.Humanoid:UnequipTools()
  907.     return end
  908.     Finale()
  909.     WeldArms()
  910.     local character = Tool.Parent
  911.     local ammoleft = script.Parent.AmmoLeft:clone()
  912.     ammoleft.Frame.LocalScript.Disabled = false
  913.     ammoleft.Parent = player.PlayerGui
  914.     mouse.Button1Down:connect(function() onActivated(mouse) end)
  915.     mouse.Button1Up:connect(function() onDeactivated(mouse) end)
  916.     mouse.Move:connect(function() onMove(mouse) end)
  917.     mouse.Idle:connect(function() onMove(mouse) end)
  918.     mouse.Move:connect(function() onLooking(mouse) end)
  919.     mouse.Idle:connect(function() onLookingCheck(mouse) end)
  920.     mouse.KeyDown:connect(onKeyDown)
  921.     mouse.Icon = "http://www.roblox.com/asset/?id=105620056"
  922.     mouse.Button2Down:connect(function () onMouseButton2Down(mouse) end)
  923.     mouse.Button2Up:connect(function () onMouseButton2Up(mouse) end)
  924.     mouse.WheelBackward:connect(function () onZoomOut(mouse) end)
  925.     if not mag.Value or not mag.Value.Parent then
  926.         FindMag()
  927.     end
  928. end
  929.  
  930. function onUnequip()
  931.     Finale()
  932.     RemoveWelds()
  933.     r1 = 0
  934.     r2 = 0
  935.     rightweld = nil
  936.     leftweld = nil
  937.     switching = false
  938.     firstlock = false
  939.     leftdown = false
  940.     if player.Backpack.GlobalFunctions.sprinting.Value then
  941.         player.Character.Humanoid.WalkSpeed = 23
  942.         camera.FieldOfView = 75
  943.     else
  944.         player.Character.Humanoid.WalkSpeed = 16
  945.         camera.FieldOfView = 70
  946.     end
  947.     if script.Parent:FindFirstChild("FlashLight",true) then
  948.         script.Parent:FindFirstChild("FlashLight",true).Enabled = false
  949.     end
  950.     local emma = player.Character.Head:GetChildren()
  951.     for z = 1, #emma do
  952.         if emma[z].className == "Sound" then
  953.             if emma[z].SoundId == "rbxasset://sounds/bfsl-minifigfoots1.mp3" then
  954.                 emma[z].Pitch = 1
  955.             end
  956.         end
  957.     end
  958.     local gcharacter = Tool.Parent.Parent
  959.     local g = gcharacter.PlayerGui:GetChildren()
  960.     for i = 1, #g do
  961.         if g[i].Name == "AmmoLeft" then
  962.             g[i]:Destroy()
  963.         end
  964.     end
  965. end
  966.  
  967. function onMagChanged()
  968.     wait()
  969.     if not mag.Value or not mag.Value.Parent then
  970.         FindMag()
  971.         if game.Players.LocalPlayer.PlayerGui:findFirstChild("AmmoLeft") then
  972.             game.Players.LocalPlayer.PlayerGui.AmmoLeft.Shoot.Value = true
  973.         end
  974.     end
  975. end
  976.  
  977. function onGunChanged()
  978.     wait()
  979.     if script.Parent:FindFirstChild("primarymarker") then
  980.         if player.playerstats.slots.slotprimary.Value == 0 then
  981.             script.Parent:Destroy()
  982.         end
  983.     elseif script.Parent:FindFirstChild("secondarymarker") then
  984.         if player.playerstats.slots.slotsecondary.Value == 0 then
  985.             script.Parent:Destroy()
  986.         end
  987.     end
  988. end
  989.  
  990. script.Parent.Equipped:connect(onEquip)
  991. script.Parent.Unequipped:connect(onUnequip)
  992. player.playerstats.slots.DescendantRemoving:connect(onMagChanged)
  993. Finale()
  994.  
  995. if script.Parent:FindFirstChild("primarymarker") then
  996.     player.playerstats.slots.slotprimary.Changed:connect(onGunChanged)
  997. end
  998. if script.Parent:FindFirstChild("secondarymarker") then
  999.     player.playerstats.slots.slotsecondary.Changed:connect(onGunChanged)
  1000. end
  1001.  
  1002. while true do
  1003.     if firstlock and not switching then
  1004.         if player.Character.Humanoid.WalkSpeed == 16 then
  1005.             player.Character.Humanoid.WalkSpeed = 8
  1006.         end
  1007.         findWelds()
  1008.         if leftweld and rightweld then
  1009.             if rX > 0.0025 or rX < -0.0025 then
  1010.                 camera.Focus = camera.Focus - Vector3.new(rX/4,0,0)
  1011.                 rX = rX*3/4
  1012.             else
  1013.                 rX = 0
  1014.             end
  1015.             if rY > 0.00625 then
  1016.                 camera.Focus = camera.Focus - Vector3.new(0,rY/4,0)
  1017.                 rY = rY*3/4
  1018.             else
  1019.                 rY = 0
  1020.             end
  1021.             if rZ > 0.0025 or rZ < -0.0025 then
  1022.                 camera.Focus = camera.Focus - Vector3.new(0,0,rZ/4)
  1023.                 rZ = rZ*3/4
  1024.             else
  1025.                 rZ = 0
  1026.             end
  1027.         end
  1028.     end
  1029.     wait()
  1030. end
Advertisement
Add Comment
Please, Sign In to add comment