Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Made by 1ndrew
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- BlockMesh2 = Instance.new("BlockMesh")
- Part3 = Instance.new("Part")
- BlockMesh4 = Instance.new("BlockMesh")
- Part5 = Instance.new("Part")
- CylinderMesh6 = Instance.new("CylinderMesh")
- Part7 = Instance.new("Part")
- PointLight8 = Instance.new("PointLight")
- BillboardGui9 = Instance.new("BillboardGui")
- ImageLabel10 = Instance.new("ImageLabel")
- CylinderMesh11 = Instance.new("CylinderMesh")
- Part12 = Instance.new("Part")
- Sound13 = Instance.new("Sound")
- Part14 = Instance.new("Part")
- Part15 = Instance.new("Part")
- CylinderMesh16 = Instance.new("CylinderMesh")
- LocalScript17 = Instance.new("LocalScript")
- IntValue18 = Instance.new("IntValue")
- ScreenGui19 = Instance.new("ScreenGui")
- ImageLabel20 = Instance.new("ImageLabel")
- Frame21 = Instance.new("Frame")
- ImageLabel22 = Instance.new("ImageLabel")
- Frame23 = Instance.new("Frame")
- TextLabel24 = Instance.new("TextLabel")
- TextLabel25 = Instance.new("TextLabel")
- TextLabel26 = Instance.new("TextLabel")
- TextLabel27 = Instance.new("TextLabel")
- TextLabel28 = Instance.new("TextLabel")
- Frame29 = Instance.new("Frame")
- Frame30 = Instance.new("Frame")
- TextLabel31 = Instance.new("TextLabel")
- TextLabel32 = Instance.new("TextLabel")
- TextLabel33 = Instance.new("TextLabel")
- TextLabel34 = Instance.new("TextLabel")
- TextLabel35 = Instance.new("TextLabel")
- Frame36 = Instance.new("Frame")
- TextLabel37 = Instance.new("TextLabel")
- TextLabel38 = Instance.new("TextLabel")
- TextLabel39 = Instance.new("TextLabel")
- Frame40 = Instance.new("Frame")
- TextLabel41 = Instance.new("TextLabel")
- Frame42 = Instance.new("Frame")
- Frame43 = Instance.new("Frame")
- Frame44 = Instance.new("Frame")
- Frame45 = Instance.new("Frame")
- Frame46 = Instance.new("Frame")
- Frame47 = Instance.new("Frame")
- Frame48 = Instance.new("Frame")
- Frame49 = Instance.new("Frame")
- Frame50 = Instance.new("Frame")
- Frame51 = Instance.new("Frame")
- Frame52 = Instance.new("Frame")
- Frame53 = Instance.new("Frame")
- Frame54 = Instance.new("Frame")
- Frame55 = Instance.new("Frame")
- Frame56 = Instance.new("Frame")
- Frame57 = Instance.new("Frame")
- Frame58 = Instance.new("Frame")
- Frame59 = Instance.new("Frame")
- Frame60 = Instance.new("Frame")
- Frame61 = Instance.new("Frame")
- Frame62 = Instance.new("Frame")
- Frame63 = Instance.new("Frame")
- Frame64 = Instance.new("Frame")
- Frame65 = Instance.new("Frame")
- Frame66 = Instance.new("Frame")
- Frame67 = Instance.new("Frame")
- TextLabel68 = Instance.new("TextLabel")
- TextLabel69 = Instance.new("TextLabel")
- TextLabel70 = Instance.new("TextLabel")
- TextLabel71 = Instance.new("TextLabel")
- Frame72 = Instance.new("Frame")
- Frame73 = Instance.new("Frame")
- Frame74 = Instance.new("Frame")
- TextLabel75 = Instance.new("TextLabel")
- TextLabel76 = Instance.new("TextLabel")
- TextLabel77 = Instance.new("TextLabel")
- TextLabel78 = Instance.new("TextLabel")
- ImageLabel79 = Instance.new("ImageLabel")
- TextLabel80 = Instance.new("TextLabel")
- TextLabel81 = Instance.new("TextLabel")
- Frame82 = Instance.new("Frame")
- Frame83 = Instance.new("Frame")
- TextLabel84 = Instance.new("TextLabel")
- TextLabel85 = Instance.new("TextLabel")
- TextLabel86 = Instance.new("TextLabel")
- TextLabel87 = Instance.new("TextLabel")
- ImageLabel88 = Instance.new("ImageLabel")
- TextLabel89 = Instance.new("TextLabel")
- TextLabel90 = Instance.new("TextLabel")
- Frame91 = Instance.new("Frame")
- ImageLabel92 = Instance.new("ImageLabel")
- TextLabel93 = Instance.new("TextLabel")
- Script94 = Instance.new("Script")
- IntValue95 = Instance.new("IntValue")
- IntValue96 = Instance.new("IntValue")
- IntValue97 = Instance.new("IntValue")
- IntValue98 = Instance.new("IntValue")
- IntValue99 = Instance.new("IntValue")
- Part100 = Instance.new("Part")
- SpecialMesh101 = Instance.new("SpecialMesh")
- ManualWeld102 = Instance.new("ManualWeld")
- Part103 = Instance.new("Part")
- BlockMesh104 = Instance.new("BlockMesh")
- Part105 = Instance.new("Part")
- SpecialMesh106 = Instance.new("SpecialMesh")
- Part107 = Instance.new("Part")
- BlockMesh108 = Instance.new("BlockMesh")
- Part109 = Instance.new("Part")
- BlockMesh110 = Instance.new("BlockMesh")
- Part111 = Instance.new("Part")
- SpecialMesh112 = Instance.new("SpecialMesh")
- ManualWeld113 = Instance.new("ManualWeld")
- Part114 = Instance.new("Part")
- SpecialMesh115 = Instance.new("SpecialMesh")
- ManualWeld116 = Instance.new("ManualWeld")
- Part117 = Instance.new("Part")
- SpecialMesh118 = Instance.new("SpecialMesh")
- ManualWeld119 = Instance.new("ManualWeld")
- Part120 = Instance.new("Part")
- SpecialMesh121 = Instance.new("SpecialMesh")
- Part122 = Instance.new("Part")
- SpecialMesh123 = Instance.new("SpecialMesh")
- Part124 = Instance.new("Part")
- BlockMesh125 = Instance.new("BlockMesh")
- Part126 = Instance.new("Part")
- BlockMesh127 = Instance.new("BlockMesh")
- Part128 = Instance.new("Part")
- SpecialMesh129 = Instance.new("SpecialMesh")
- Part130 = Instance.new("Part")
- SpecialMesh131 = Instance.new("SpecialMesh")
- ManualWeld132 = Instance.new("ManualWeld")
- Part133 = Instance.new("Part")
- SpecialMesh134 = Instance.new("SpecialMesh")
- Part135 = Instance.new("Part")
- SpecialMesh136 = Instance.new("SpecialMesh")
- Part137 = Instance.new("Part")
- BlockMesh138 = Instance.new("BlockMesh")
- Part139 = Instance.new("Part")
- BlockMesh140 = Instance.new("BlockMesh")
- Part141 = Instance.new("Part")
- BlockMesh142 = Instance.new("BlockMesh")
- Part143 = Instance.new("Part")
- SpecialMesh144 = Instance.new("SpecialMesh")
- Part145 = Instance.new("Part")
- BlockMesh146 = Instance.new("BlockMesh")
- Part147 = Instance.new("Part")
- BlockMesh148 = Instance.new("BlockMesh")
- Part149 = Instance.new("Part")
- SpecialMesh150 = Instance.new("SpecialMesh")
- Part151 = Instance.new("Part")
- CylinderMesh152 = Instance.new("CylinderMesh")
- Part153 = Instance.new("Part")
- BlockMesh154 = Instance.new("BlockMesh")
- ManualWeld155 = Instance.new("ManualWeld")
- Part156 = Instance.new("Part")
- BlockMesh157 = Instance.new("BlockMesh")
- Part158 = Instance.new("Part")
- SpecialMesh159 = Instance.new("SpecialMesh")
- Part160 = Instance.new("Part")
- CylinderMesh161 = Instance.new("CylinderMesh")
- Part162 = Instance.new("Part")
- SpecialMesh163 = Instance.new("SpecialMesh")
- Part164 = Instance.new("Part")
- SpecialMesh165 = Instance.new("SpecialMesh")
- Part166 = Instance.new("Part")
- SpecialMesh167 = Instance.new("SpecialMesh")
- Part168 = Instance.new("Part")
- CylinderMesh169 = Instance.new("CylinderMesh")
- Part170 = Instance.new("Part")
- BlockMesh171 = Instance.new("BlockMesh")
- Part172 = Instance.new("Part")
- BlockMesh173 = Instance.new("BlockMesh")
- Part174 = Instance.new("Part")
- BlockMesh175 = Instance.new("BlockMesh")
- Part176 = Instance.new("Part")
- CylinderMesh177 = Instance.new("CylinderMesh")
- ManualWeld178 = Instance.new("ManualWeld")
- Tool0.Name = "UNSC Shotgun"
- Tool0.Parent = mas
- Part1.Parent = Tool0
- Part1.Material = Enum.Material.Metal
- Part1.BrickColor = BrickColor.new("Dark stone grey")
- Part1.Anchored = true
- Part1.FormFactor = Enum.FormFactor.Plate
- Part1.Size = Vector3.new(1, 0.400000006, 1)
- Part1.CFrame = CFrame.new(2.5, 1.15334594, 46.5766602, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part1.Position = Vector3.new(2.5, 1.15334594, 46.5766602)
- Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
- BlockMesh2.Parent = Part1
- BlockMesh2.Scale = Vector3.new(0.0666666701, 0.166666672, 0.0666666701)
- BlockMesh2.Scale = Vector3.new(0.0666666701, 0.166666672, 0.0666666701)
- Part3.Parent = Tool0
- Part3.Material = Enum.Material.Metal
- Part3.Rotation = Vector3.new(-180, 0, -180)
- Part3.Anchored = true
- Part3.FormFactor = Enum.FormFactor.Plate
- Part3.Size = Vector3.new(1, 0.400000006, 1)
- Part3.CFrame = CFrame.new(2.5, 1.10002196, 48.5, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part3.BottomSurface = Enum.SurfaceType.Smooth
- Part3.TopSurface = Enum.SurfaceType.Smooth
- Part3.Position = Vector3.new(2.5, 1.10002196, 48.5)
- Part3.Orientation = Vector3.new(0, 180, 0)
- BlockMesh4.Parent = Part3
- BlockMesh4.Scale = Vector3.new(0.100000001, 0.0666666701, 0.300000012)
- BlockMesh4.Scale = Vector3.new(0.100000001, 0.0666666701, 0.300000012)
- Part5.Name = "Mag"
- Part5.Parent = Tool0
- Part5.Material = Enum.Material.Metal
- Part5.BrickColor = BrickColor.new("Bright yellow")
- Part5.Reflectance = 0.10000000149012
- Part5.Rotation = Vector3.new(90, -90, 0)
- Part5.CanCollide = false
- Part5.FormFactor = Enum.FormFactor.Symmetric
- Part5.Size = Vector3.new(1, 1, 1)
- Part5.CFrame = CFrame.new(2.5, 0.70668, 47.7999878, -4.37113883e-08, 0, -1, -1, -4.37113883e-08, 4.37113883e-08, -4.37113883e-08, 1, 1.91068547e-15)
- Part5.BottomSurface = Enum.SurfaceType.Smooth
- Part5.TopSurface = Enum.SurfaceType.Smooth
- Part5.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part5.Position = Vector3.new(2.5, 0.70668, 47.7999878)
- Part5.Orientation = Vector3.new(0, -90, -90)
- Part5.Color = Color3.new(0.960784, 0.803922, 0.188235)
- CylinderMesh6.Parent = Part5
- CylinderMesh6.Scale = Vector3.new(0.100000001, 0.13333334, 0.100000001)
- CylinderMesh6.Scale = Vector3.new(0.100000001, 0.13333334, 0.100000001)
- Part7.Name = "Main"
- Part7.Parent = Tool0
- Part7.Material = Enum.Material.Metal
- Part7.BrickColor = BrickColor.new("Really black")
- Part7.Transparency = 1
- Part7.Rotation = Vector3.new(90, 90, 0)
- Part7.Anchored = true
- Part7.FormFactor = Enum.FormFactor.Custom
- Part7.Size = Vector3.new(0.25, 0.25, 0.25)
- Part7.CFrame = CFrame.new(2.4749999, 0.99000001, 46.0999985, -2.61729589e-08, 5.96046519e-08, 1, 1, 3.1868769e-08, 2.61729589e-08, -3.1868769e-08, 1, -5.96046519e-08)
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part7.Position = Vector3.new(2.4749999, 0.99000001, 46.0999985)
- Part7.Orientation = Vector3.new(0, 90, 90)
- Part7.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- PointLight8.Name = "FlashFX"
- PointLight8.Parent = Part7
- PointLight8.Color = Color3.new(1, 1, 0)
- PointLight8.Enabled = false
- PointLight8.Brightness = 10
- PointLight8.Range = 6
- PointLight8.Shadows = true
- PointLight8.Color = Color3.new(1, 1, 0)
- BillboardGui9.Name = "FlashGui"
- BillboardGui9.Parent = Part7
- BillboardGui9.Size = UDim2.new(1.10000002, 0, 1.10000002, 0)
- BillboardGui9.Enabled = false
- ImageLabel10.Name = "Label"
- ImageLabel10.Parent = BillboardGui9
- ImageLabel10.Transparency = 1
- ImageLabel10.Size = UDim2.new(1, 0, 1, 0)
- ImageLabel10.BackgroundTransparency = 1
- ImageLabel10.Image = "http://www.roblox.com/asset/?id=117472237"
- CylinderMesh11.Parent = Part7
- CylinderMesh11.Offset = Vector3.new(0, -0.248999998, 0)
- CylinderMesh11.Scale = Vector3.new(0.600000024, 1, 0.600000024)
- CylinderMesh11.Scale = Vector3.new(0.600000024, 1, 0.600000024)
- Part12.Name = "Handle"
- Part12.Parent = Tool0
- Part12.Material = Enum.Material.Metal
- Part12.Transparency = 1
- Part12.Anchored = true
- Part12.CanCollide = false
- Part12.FormFactor = Enum.FormFactor.Custom
- Part12.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
- Part12.CFrame = CFrame.new(2.5, 0.660000026, 49.1769981, 1, -4.10676591e-07, 2.92998536e-13, 4.10676591e-07, 1, -7.13453232e-07, 0, 7.13453232e-07, 1)
- Part12.BottomSurface = Enum.SurfaceType.Smooth
- Part12.TopSurface = Enum.SurfaceType.Smooth
- Part12.Position = Vector3.new(2.5, 0.660000026, 49.1769981)
- Sound13.Name = "FireSound"
- Sound13.Parent = Part12
- Sound13.SoundId = "http://roblox.com/asset/?id=330706798"
- Sound13.Volume = 1
- Part14.Name = "AimPart"
- Part14.Parent = Tool0
- Part14.Material = Enum.Material.Metal
- Part14.Transparency = 1
- Part14.Anchored = true
- Part14.CanCollide = false
- Part14.FormFactor = Enum.FormFactor.Custom
- Part14.Size = Vector3.new(0.299999952, 0.200000003, 0.200000003)
- Part14.CFrame = CFrame.new(2.5, 1.20099795, 48.3769989, 1, -1.98412908e-09, -5.96046519e-08, 1.98413042e-09, 1, 2.09293631e-08, 5.96046519e-08, -2.09293631e-08, 1)
- Part14.BottomSurface = Enum.SurfaceType.Smooth
- Part14.TopSurface = Enum.SurfaceType.Smooth
- Part14.Position = Vector3.new(2.5, 1.20099795, 48.3769989)
- Part15.Name = "Mag"
- Part15.Parent = Tool0
- Part15.Material = Enum.Material.Metal
- Part15.BrickColor = BrickColor.new("Bright red")
- Part15.Reflectance = 0.10000000149012
- Part15.Rotation = Vector3.new(90, -90, 0)
- Part15.CanCollide = false
- Part15.FormFactor = Enum.FormFactor.Symmetric
- Part15.Size = Vector3.new(1, 1, 1)
- Part15.CFrame = CFrame.new(2.5, 0.70668, 48, -4.37113883e-08, 0, -1, -1, -4.37113883e-08, 4.37113883e-08, -4.37113883e-08, 1, 1.91068547e-15)
- Part15.BottomSurface = Enum.SurfaceType.Smooth
- Part15.TopSurface = Enum.SurfaceType.Smooth
- Part15.Color = Color3.new(0.768628, 0.156863, 0.109804)
- Part15.Position = Vector3.new(2.5, 0.70668, 48)
- Part15.Orientation = Vector3.new(0, -90, -90)
- Part15.Color = Color3.new(0.768628, 0.156863, 0.109804)
- CylinderMesh16.Parent = Part15
- CylinderMesh16.Scale = Vector3.new(0.100000001, 0.266666681, 0.100000001)
- CylinderMesh16.Scale = Vector3.new(0.100000001, 0.266666681, 0.100000001)
- LocalScript17.Name = "Gun_Main"
- LocalScript17.Parent = Tool0
- table.insert(cors,sandbox(LocalScript17,function()
- repeat wait() until game.Players.LocalPlayer.Character
- repeat wait() until game.Players.LocalPlayer.Character:IsDescendantOf(game.Workspace)
- wait(1 / 20)
- --------------------------------------------------------------------------------------
- --------------------[ IGNORE MODEL ]--------------------------------------------------
- --------------------------------------------------------------------------------------
- local Ignore_Code = script:WaitForChild("Ignore_Code")
- repeat wait() until Ignore_Code.Value ~= 0
- local Ignore_Model = game.Workspace:WaitForChild("Ignore_Model_"..Ignore_Code.Value)
- --------------------------------------------------------------------------------------
- --------------------[ CONSTANTS ]-----------------------------------------------------
- --------------------------------------------------------------------------------------
- local Gun = script.Parent
- local Handle = Gun:WaitForChild("Handle")
- local AimPart = Gun:WaitForChild("AimPart")
- local Main = Gun:WaitForChild("Main")
- local Ammo = Gun:WaitForChild("Ammo")
- local ClipSize = Gun:WaitForChild("ClipSize")
- local StoredAmmo = Gun:WaitForChild("StoredAmmo")
- local LethalGrenades = Gun:WaitForChild("LethalGrenades")
- local TacticalGrenades = Gun:WaitForChild("TacticalGrenades")
- local S = { --These are the settings, change them however you like
- GunName = "Unsc Shotgun"; --This is the name that will be displayed on the Tool
- Description = "From halo lol"; --This will be the text that is displayed above the tool when the mouse is hovering over it
- GunType = { --[[These are the 5 gun types you can have. Set whichever ones you want to true. (NOTE: Semi and Auto can't both be
- true, and Burst and Auto can't both be true)]]
- Semi = false; --Set this true if you want the gun to be semi-automatic. (Pistols, Snipers, etc)
- Auto = false; --Set this true if you want the gun to be fully automatic. (Assault Rifles, Submachine guns, machine guns, etc)
- Burst = false; --Set this true if you want the gun to be burst fire. (Battle rifles, assault rifles, etc)
- Shot = true; --Set this true if you want the gun to be a shotgun. (NOTE: Shot and auto can both be true)
- Explosive = false; --Set this true if you want the projectiles to be explosive. (Rocket launchers, grenade launchers, etc)
- };
- BurstAmount = 3; --This is how many bullets will be fired in one burst (if Burst is true)
- BurstTime = 0.2; --This is how long it takes for a burst to complete
- BurstWait = 0.1; --This is how much time you have to wait before you can fire another burst
- ShotAmount = 5; --This is how many bullets will be fired in one shot (if Shot is true)
- ExplosionRadius = 20; --This is the radius of the explosion when the bullet hits a target. (If Explosive is true)
- ExplosionPressure = 5e5; --This is the pressure of the explosion when the bullet hits the target
- ExplosionType = Enum.ExplosionType.NoCraters; --This is the type of explosion
- --[[
- (0 or "NoCraters" or Enum.ExplosionType.NoCraters) means that the explosion will not damage terrain
- (1 or "Craters" or Enum.ExplosionType.Craters) means that the explosion will leave craters in terrain
- (2 or "CratersAndDebris" or Enum.ExplosionType.CratersAndDebris) means that the explosion will leave craters and debris in terrain
- --]]
- ExplosionSound = "rbxassetid://138499093"; --This is what the sound of the explosion will be
- ExplosionSoundPitch = 1; --This is what the pitch of the explosion sound will be
- ExplosionSoundVolume = 1; --This is what the volume of the explosion sound will be
- RayCastExplosions = false; --[[This is whether or not explosions will have raycasting. If this is true, humanoids behind walls
- won't be damaged. If this is false, any humanoid within the radius will be damaged. (NOTE: RangeBasedDamage has to be true in
- order for explosions to have raycasting)]]
- RangeBasedDamage = true; --[[This is whether or not will depend on how far the object is from the center of the explosion. If this
- is true, the farther a humanoid is from the blast center, the less damage it'll take. If this is false, any object within
- the explosion's radius will have its joints broken]]
- PlayerArms = true; --This is whether or not the fake arms will look like the Player's arms
- FakeArmTransparency = 0; --This is the transparency of the fake arms
- FakeArmRealBodyColor = true; --This is whether or not the color of the fake arm will be the color of the player's real arms
- FakeArmColor = BrickColor.new("Pastel brown"); --This is what the color of the fake arms will be if FakeArmRealBodyColor is false
- ArmC1_UnAimed = { --This table contains the CFrames of the arms when the gun is not aimed
- Left = CFrame.new(0.1, 1.5, -0.3) * CFrame.Angles(0, 0, math.rad(-50)); --This is the cframe of the left arm
- Right = CFrame.new(0.4, 0.25, -0.3) * CFrame.Angles(0, 0, math.rad(25)); --This is the cframe of the right arm
- };
- ArmC1_Aimed = { --This table contains the CFrames of the arms when the gun is aimed
- Left = CFrame.new(-0.1, 1.2, 0.1) * CFrame.Angles(0, 0, math.rad(-35)); --This is the cframe of the left arm
- Right = CFrame.new(0.3, 0.707, -0.01) * CFrame.Angles(0, 0, math.rad(50)); --This is the cframe of the right arm
- };
- PlayerAnimations = true; --This is whether or not the player will have custom animations
- AimAnimation = true; --This is whether or not there is an animation for aiming down the sights
- SelectFireAnimation = true; --This is whether or not there is an animation for changing the fire mode
- ReloadAnimation = true; --This is whether or not there is an animation for reloading
- StanceAnimation = true; --This is whether or not there is an animation for changing stance
- AimSpeed = 0.15; --This is how long the gun will take to fully aim down the sights
- MaxZoom = 40; --This is the FOV that the Camera will have when the gun is fully aimed down
- HoldMouseOrKeyToADS = true; --This is whether or not you have to hold the right mouse or the ADS key to ADS
- GuiScope = false; --This is whether or not your Scope will be a gui instead of a normal sight
- GuiId = "http://www.roblox.com/asset/?id=160682367"; --This is the ImageId of the GuiScope
- ScopeSway = 2; --This is the sway, in radians, of the camera
- ScopeSteadyTime = 8; --This is how long you can hold your breath to steady the scope
- SteadyCooldownTime = 4; --This is how long it takes to fully retake your breath
- UnSteadyOnFire = true; --This is whether or not the camera will become unsteady when you fire the gun
- FireRate = 600; --This is how many bullets per minute the gun will fire
- BulletRange = 1000; --This is how far the bullet will travel before it is no longer effective
- InstantHit = false; --[[This is whether or not the bullet will hit a target instantly. If it is false, the bullet will travel at a
- specific speed till it hits a target]]
- BulletVelocity = 2400; --This is how fast the bullet will travel in studs per second
- Damage = 25; --This is the base damage. That means that this is the least amount of damage that will be inflicted
- Multipliers = { --[[These are the damage multipliers. There's a spread of +0.1. That means that if the multiplier is 1, the actual
- multiplier will range from 1 - 1.1]]
- Chest = 1; --This is what the damage will be multiplied by if the bullet hits the chest
- Head = 1.5; --This is what the damage will be multiplied by if the bullet hits the head or a hat
- Limbs = 1; --This is what the damage will be multiplied by if the bullet hits a limb (Arms or legs)
- };
- AllowFriendlyFire = false; --This is whether or not you can damage teammates
- CanDamageNPCs = true; --This is whether or not you can damage NPC's (Zombies, fake players, anything with a humanoid)
- RotateWhileSitting = false; --This is whether or not your player will rotate when you are sitting down
- SelectiveFire = true; --This is whether or not you can switch fire modes
- FireModes = { --This is the table of all the possible fire modes you can switch between
- Safety = true; --This mode prevents firing
- Auto = true; --This mode is full auto firing
- Burst = true; --This mode is burst fire. The settings for burst apply to this mode
- Semi = true; --This mode is semi auto fire
- };
- CanKnife = true; --This is whether or not you can knife
- KnifeMeshId = "http://www.roblox.com/asset/?id=121944778"; --This is the Mesh of the knife
- KnifeTextureId = "http://www.roblox.com/asset/?id=121944805"; --This is the Texture of the knife
- KnifeCooldown = 0.5; --This is how long you have to wait before you can knife again
- Throwables = true; --This is whether or not you have grenades
- TrajectoryAssist = true; --This is whether or not the script will show you the flight path of the grenade before you throw it
- DetonationTime = 0.5; --[[This is how long the grenade will wait to detonate (If DetonateOnHit is false, this is how long the
- grenade will wait after it's thrown. If DetonateOnHit is true, this is how long the grenade will wait after it hits something]]
- TimerStartOnHit = true; --This is whether or not the timer will start when the grenade hits something
- GrenadeColor = BrickColor.new("Black"); --This is the color of the grenade
- GrenadeSize = Vector3.new(0.8, 0.8, 0.8); --This is the size of the grenade (Doesn't apply to throwing knives)
- GrenadeBlastRadius = 12; --This is the blast radius of the explosion (Doesn't apply to non-explosive grenades)
- GrenadeBlastPressure = 5e5; --This is what the blast pressure of the explosion (Doesn't apply to non-explosive grenades)
- GrenadeExplosionType = Enum.ExplosionType.NoCraters; --This is the type of explosion (Doesn't apply to non-explosive grenades)
- --[[
- (0 or "NoCraters" or Enum.ExplosionType.NoCraters) means that the explosion will not damage terrain
- (1 or "Craters" or Enum.ExplosionType.Craters) means that the explosion will leave craters in terrain
- (2 or "CratersAndDebris" or Enum.ExplosionType.CratersAndDebris) means that the explosion will leave craters and debris in terrain
- --]]
- LethalGrenadeDamage = 150; --This is max damage that the grenade will do
- LethalGrenadeThrowVelocity = 170; --This is the speed at which the lethal grenade is thrown
- GrenadeRayCastExplosions = true; --[[This is whether or not grenade explosions will have raycasting. If this is true, humanoids
- behind walls won't be damaged. If this is false, any humanoid within the radius will be damaged. (NOTE: GrenadeRangeBasedDamage
- has to be true in order for explosions to have raycasting)]]
- GrenadeRangeBasedDamage = true; --[[This is whether or not will depend on how far the object is from the center of the explosion.
- If this is true, the farther a humanoid is from the blast center, the less damage it'll take. If this is false, any object
- within the explosion's radius will have its joints broken]]
- LethalGrenadeType = 1; --This is the lethal grenade type
- --[[
- Type 1: Frag grenade [An explosive grenade]
- Type 2: Sticky [An explosive grenade that sticks to a surface]
- Type 3: Throwing Knife [A throwable knife]
- --]]
- TacticalGrenadeThrowVelocity = 200; --This is the speed at which the tactical grenade is thrown
- GrenadeEffectRadius = 70; --[[This is the radius of the effect of the grenade. If the Grenade is a smoke, this is the radius of
- the smoke]]
- GrenadeEffectTime = 10; --[[This is the how long the grenade effect will last. If the grenade is a smoke, this is how long the
- smoke will linger]]
- TacticalGrenadeType = 1; --This is the tactical grenade type
- --[[
- Type 1: Smoke grenade [A grenade that creates a cloud of smoke]
- --]]
- GrenadeTrail = true; --This is whether or not the grenade will have a trail
- GrenadeTrailColor = BrickColor.new("Black"); --This is the color of the grenade trail
- GrenadeTrailTransparency = 0.6; --This is the transparency of the trail
- GrenadeTrailThickness = 0.3; --This is the thickness of the trail
- GrenadeTrailVisibleTime = 0.1; --This is how long the trail will be visible for
- GrenadeTrailDisappearTime = 0.2; --This is how long it will take for the trail to disappear
- BulletColor = BrickColor.new("Bright yellow"); --This is the color of the bullet
- BulletTransparency = 0; --This is the transparency of the bullet
- BulletSize = Vector3.new(0.2, 0.2, 4); --This is the actual size of the bullet
- BulletMeshSize = Vector3.new(0.5, 0.5, 1); --This is the mesh size of the bullet.
- --BulletSize * BulletMeshSize = How big the bullet looks
- BulletTrail = true; --This is whether or not there will be a trail behind the bullet
- TrailColor = BrickColor.new("Black"); --This is the color of the bullet trail
- TrailTransparency = 0.6; --This is the transparency of the trail
- TrailThickness = 0.2; --This is the thickness of the trail
- TrailVisibleTime = 0.5; --This is how long the trail will be visible for
- TrailDisappearTime = 0.5; --This is how long it will take for the trail to disappear
- BulletHoles = true; --This is whether or not bullet holes will appear where you shot
- BulletHoleTexture = "http://www.roblox.com/asset/?id=64291961"; --This is the texture of the bullet hole
- BulletHoleSize = 0.5; --This is how big the bullet hole will be in studs
- BulletHoleVisibleTime = 3; --This is how long the bullet hole will be visible for
- BulletHoleDisappearTime = 1; --This is how long it will take for the bullet hole to disappear
- Shockwaves = true; --This is whether or not a shockwave will appear where you shot. (A sphere that appears when the bullet hits)
- ShockwaveRadius = 0.3; --This is the radius of the shockwave. (If the gun type is explosion, this radius will be the blast radius)
- ShockwaveColor = BrickColor.new("Light stone grey"); --This is the color of the shockwave
- ShockwaveDuration = 0.2; --This is how long the shockwave will take to disappear
- Penetration = 2; --[[This is how many studs a bullet can penetrate into a wall. So if penetration is 2 and the wall is 3 studs
- thick, the bullet won't come out the other side]]
- BulletDropPerSecond = 0; --This is the bullet's acceleration downward per second (196.2 is normal roblox gravity)
- Recoil = {
- Aimed = 0.5; --This is the recoil the gun will have when the gun is aimed down
- Hipfire = 1.5; --This is the recoil the gun will have when the gun is fired from the hip
- };
- Spread = { --[[This spread values are how many degrees offset / 20 the bullets from the center the bullets will travel. So a spread
- of 20 would mean that the bullet's max spread in any direction is 1 degree from the center]]
- Aimed = 0; --This is the spread when the gun is aimed down. it isn't affected by the multiplier.
- Hipfire = 20; --This is the base spread when the gun is fired from the hip
- Max = 40; --This is the highest the spread can be when fired
- Multiplier = 1.1; --This is how much the spread will be multiplied by when fired. It only affects the Hipfire spread
- Walking = 30; --This is the spread while walking. It isn't affected by the multiplier
- };
- ReloadTime = 1.2; --This is how long it takes to reload the gun
- AutoReload = true; --This is whether or not the gun will reload automatically when the ammo reaches 0
- SprintTime = 7; --This is the maximum time you can sprint
- StaminaCoolTime = 4; --This is how long it takes for your stamina to fully recharge
- DolphinDive = true; --This is whether or not you can dolphin dive (Run and crouch at the same time to dive)
- DiveRechargeTime = 1; --This is how long you have to wait till you can dive or run again after you've dived
- CanChangeStance = true; --This is whether or not you can change stance. That means whether or not you can crouch or go prone
- StanceChangeSpeed = 0.25; --This is how quickly you change stance
- StandOnDeselect = true; --This is whether or not you stand up when you deselect the tool
- BaseWalkSpeed = 16; --This is the base walkspeed
- SprintSpeed = 30; --This is the walkspeed when you're sprinting
- AimedWalkSpeed = 10; --[[This is the base walkspeed when the gun is aimed down. If you crouch or go prone, the speed will change
- based on the AimedWalkSpeed to BaseWalkSpeed ratio]]
- CrouchWalkSpeed = 7; --This is the walkspeed when you're crouched
- ProneWalkSpeed = 4; --This is the walkspeed when you're prone
- --NOTE: For extra keys, go here: http://wiki.roblox.com/index.php?title=Taking_keyboard_input
- LowerStanceKey = "c"; --This is the key you press to lower your stance (Stand > Crouch > Prone)
- RaiseStanceKey = "x"; --This is the key you press to raise your stance (Prone > Crouch > Stand)
- SwitchFireKey = "v"; --This is the key you press to switch fire modes
- ReloadKey = "r"; --This is the key you press to reload
- SprintKey = string.char(48); --This is the key you press to sprint
- KnifeKey = "f"; --This is the key you press to knife
- LethalGrenadeKey = "g"; --This is the key you press to throw the lethal grenade
- TacticalGrenadeKey = "t"; --This is the key you press to throw the tactical grenade
- ADSKey = "q"; --This is the key you press to ADS. If you want ADS to just be right mouse, then make this key ""
- ScopeSteadyKey = string.char(48); --This is the key you press to steady the scope
- }
- local Player = game.Players.LocalPlayer
- local Character = Player.Character
- local Humanoid = Character:WaitForChild("Humanoid")
- local Torso = Character:WaitForChild("Torso")
- local Head = Character:WaitForChild("Head")
- local HRP = Character:WaitForChild("HumanoidRootPart")
- local Neck = Torso:WaitForChild("Neck")
- local LArm = Character:WaitForChild("Left Arm")
- local RArm = Character:WaitForChild("Right Arm")
- local LLeg = Character:WaitForChild("Left Leg")
- local RLeg = Character:WaitForChild("Right Leg")
- local M2 = Player:GetMouse()
- local Main_Gui = script:WaitForChild("Main_Gui")
- local RS = game:GetService("RunService").RenderStepped
- local Camera = game.Workspace.CurrentCamera
- local ABS, HUGE, FLOOR, CEIL = math.abs, math.huge, math.floor, math.ceil
- local RAD, SIN, ATAN, COS = math.rad, math.sin, math.atan2, math.cos
- local VEC3 = Vector3.new
- local CF, CFANG = CFrame.new, CFrame.Angles
- local INSERT = table.insert
- local MaxStamina = S.SprintTime * 60
- local MaxSteadyTime = S.ScopeSteadyTime * 60
- local LethalIcons = {
- "http://www.roblox.com/asset/?id=194849880";
- "http://www.roblox.com/asset/?id=195727791";
- "http://www.roblox.com/asset/?id=195728137";
- }
- local TacticalIcons = {
- "http://www.roblox.com/asset/?id=195728473";
- "http://www.roblox.com/asset/?id=195728693";
- }
- local Ignore = {
- Character;
- Ignore_Model;
- }
- local StanceOffset = {
- VEC3(0, 0, 0);
- VEC3(0, -1, 0);
- VEC3(0, -3, 0);
- }
- local Shoulders = {
- Right = Torso:WaitForChild("Right Shoulder");
- Left = Torso:WaitForChild("Left Shoulder")
- }
- local ArmC0 = {
- CF(-1.5, 0, 0) * CFANG(RAD(90), 0, 0);
- CF(1.5, 0, 0) * CFANG(RAD(90), 0, 0);
- }
- local Sine = function(X)
- return SIN(RAD(X))
- end
- local Linear = function(X)
- return (X / 90)
- end
- --------------------------------------------------------------------------------------
- --------------------[ VARIABLES ]-----------------------------------------------------
- --------------------------------------------------------------------------------------
- local Selected = false
- local Idleing = false
- local Walking = false
- local Running = false
- local Aimed = false
- local Aiming = false
- local Reloading = false
- local BreakReload = false
- local Knifing = false
- local ThrowingGrenade = false
- local MB1_Down = false
- local CanFire = true
- local KnifeReady = true
- local CanRun = true
- local RunTween = false
- local Run_Key_Pressed = false
- local ChargingStamina = false
- local AimingIn = false
- local AimingOut = false
- local Stamina = S.SprintTime * 60
- local CurrentSteadyTime = S.ScopeSteadyTime * 60
- local CameraSteady = false
- local TakingBreath = false
- local Grip = nil
- local Aimed_GripCF = nil
- local Gui_Clone = nil
- local CurrentSpread = S.Spread.Hipfire
- local CurrentRecoil = S.Recoil.Hipfire
- local AmmoInClip = 0
- local Stance = 0
- local StanceSway = 1
- local CameraSway = 1
- local HeadRot = 0
- local ArmTilt = 0
- local LastBeat = 0
- local Parts = {}
- local Connections = {}
- local PrevNeckCF = {
- C0 = nil;
- C1 = nil;
- }
- local Keys = {}
- --------------------------------------------------------------------------------------
- --------------------[ PRE-LOADING ]---------------------------------------------------
- --------------------------------------------------------------------------------------
- local ContentProvider = game:GetService("ContentProvider")
- ContentProvider:Preload(S.ExplosionSound)
- ContentProvider:Preload(S.KnifeMeshId)
- ContentProvider:Preload(S.KnifeTextureId)
- ContentProvider:Preload(S.BulletHoleTexture)
- --------------------------------------------------------------------------------------
- --------------------[ ANIMATIONS ]----------------------------------------------------
- --------------------------------------------------------------------------------------
- local AnimAng = {0, 0, 0, 0, 0}
- local AnimCF = function(State, Ang)
- if State ~= "Running" then
- if (not Aimed) then
- if State == "Idleing" then
- return CF(
- RAD(SIN(Ang)) / 2 * StanceSway,
- 1 + RAD(SIN(Ang * 5 / 2)) / 2 * StanceSway, 0
- )
- elseif State == "Walking" then
- return CF(
- RAD(SIN(Ang)) * 2 * StanceSway,
- 1 + RAD(ABS(SIN(Ang))) * 2 * StanceSway, 0
- ) * CFANG(0, RAD(SIN(Ang)) / 3, 0)
- end
- elseif Aimed then
- if State == "Idleing" then
- return CF(
- RAD(SIN(Ang)) / 4 * StanceSway,
- 1 + RAD(SIN(Ang * 5 / 2)) / 4 * StanceSway, 0
- )
- elseif State == "Walking" then
- return CF(
- RAD(SIN(Ang)) / 3 * StanceSway,
- 1 + RAD(ABS(SIN(Ang))) / 3 * StanceSway, 0
- )
- end
- end
- elseif State == "Running" then
- return CF(
- SIN(Ang) / 6 * StanceSway,
- 0.9 + ABS(SIN(Ang)) / 5 * StanceSway, 0
- ) * CFANG(0, -RAD(SIN(Ang)) * 7, 0)
- end
- end
- function Animate()
- local IsIdleing = false
- local IsWalking = false
- local IsRunning = false
- spawn(function()
- while Selected do
- IsIdleing = Idleing and (not Walking) and (not Reloading) and (not Knifing) and (not ThrowingGrenade) and Selected
- IsWalking = (not Idleing) and Walking and (not Running) and (not Reloading) and (not Knifing) and (not ThrowingGrenade) and Selected
- IsRunning = (not Idleing) and Walking and Running and (not Aiming) and (not Knifing) and (not ThrowingGrenade) and Selected
- RS:wait()
- end
- IsIdleing = false
- IsWalking = false
- IsRunning = false
- end)
- spawn(function()
- if S.PlayerAnimations then
- TweenJoint(LWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, 0.15)
- TweenJoint(RWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, 0.15)
- local PreviousArmTilt = ArmTilt
- while Selected do
- repeat RS:wait() until (ArmTilt ~= PreviousArmTilt) or (not Selected)
- if (not IsRunning) and (not Aimed) and (not Reloading) and (not Knifing) and (not ThrowingGrenade) and Selected then
- PreviousArmTilt = ArmTilt
- TweenJoint(LWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, 0.15)
- TweenJoint(RWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, 0.15)
- end
- RS:wait()
- end
- end
- end)
- spawn(function()
- while Selected do
- if IsIdleing then
- if (not Aimed) and (not Aiming) then
- Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
- UDim2.new(0, 70, 0, 70),
- UDim2.new(0, -35, 0, -35),
- Enum.EasingDirection.Out,
- Enum.EasingStyle.Linear,
- S.PlayerAnimations and 0.15 or 0,
- true
- )
- if S.PlayerAnimations then
- TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Sine, 0.15)
- TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Sine, 0.15)
- TweenJoint(AnimWeld, AnimCF("Idleing", AnimAng[1]), CF(), Sine, 0.15)
- TweenJoint(Grip, Grip.C0, CFANG(0, RAD(20), 0), Sine, 0.15)
- else
- if (not LWeld:FindFirstChild("TweenCode"))
- and (not RWeld:FindFirstChild("TweenCode"))
- and (not ABWeld:FindFirstChild("TweenCode"))
- and (not AnimWeld:FindFirstChild("TweenCode")) then
- LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_UnAimed.Left
- RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_UnAimed.Right
- AnimWeld.C0 = CF(0, 1, 0)
- Grip.C1 = CFANG(0, RAD(20), 0)
- end
- end
- elseif Aimed and (not Aiming) then
- if S.PlayerAnimations then
- TweenJoint(LWeld, ArmC0[1], S.ArmC1_Aimed.Left, Sine, 0.15)
- TweenJoint(RWeld, ArmC0[2], S.ArmC1_Aimed.Right, Sine, 0.15)
- TweenJoint(AnimWeld, AnimCF("Idleing", AnimAng[2]), CF(), Sine, 0.15)
- else
- if (not LWeld:FindFirstChild("TweenCode"))
- and (not RWeld:FindFirstChild("TweenCode"))
- and (not ABWeld:FindFirstChild("TweenCode"))
- and (not AnimWeld:FindFirstChild("TweenCode")) then
- LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_Aimed.Left
- RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_Aimed.Right
- AnimWeld.C0 = CF(0, 1, 0)
- Grip.C1 = Aimed_GripCF
- end
- end
- end
- if S.PlayerAnimations then
- wait(0.15)
- RunTween = false
- while IsIdleing do
- if (not LWeld:FindFirstChild("TweenCode"))
- and (not RWeld:FindFirstChild("TweenCode"))
- and (not ABWeld:FindFirstChild("TweenCode"))
- and (not AnimWeld:FindFirstChild("TweenCode")) then
- if (not Aimed) and (not Aiming) then
- AnimWeld.C0 = AnimCF("Idleing", AnimAng[1])
- AnimAng[1] = AnimAng[1] + 0.03 * StanceSway
- elseif Aimed and (not Aiming) then
- AnimWeld.C0 = AnimCF("Idleing", AnimAng[2])
- AnimAng[2] = AnimAng[2] + 0.015 * StanceSway
- end
- end
- RS:wait()
- end
- AnimAng[1], AnimAng[2] = 0, 0
- end
- end
- if IsWalking then
- if (not Aimed) and (not Aiming) then
- Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
- UDim2.new(0, 150, 0, 150),
- UDim2.new(0, -75, 0, -75),
- Enum.EasingDirection.Out,
- Enum.EasingStyle.Linear,
- S.PlayerAnimations and 0.15 or 0,
- true
- )
- if S.PlayerAnimations then
- TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Sine, 0.15)
- TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Sine, 0.15)
- TweenJoint(AnimWeld, AnimCF("Walking", AnimAng[3]), CF(), Sine, 0.15)
- TweenJoint(Grip, Grip.C0, CFANG(0, RAD(20), 0), Sine, 0.15)
- else
- if (not LWeld:FindFirstChild("TweenCode"))
- and (not RWeld:FindFirstChild("TweenCode"))
- and (not ABWeld:FindFirstChild("TweenCode"))
- and (not AnimWeld:FindFirstChild("TweenCode")) then
- LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_UnAimed.Left
- RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_UnAimed.Right
- AnimWeld.C0 = CF(0, 1, 0)
- Grip.C1 = CFANG(0, RAD(20), 0)
- end
- end
- elseif Aimed and (not Aiming) then
- if S.PlayerAnimations then
- TweenJoint(LWeld, ArmC0[1], S.ArmC1_Aimed.Left, Sine, 0.15)
- TweenJoint(RWeld, ArmC0[2], S.ArmC1_Aimed.Right, Sine, 0.15)
- TweenJoint(AnimWeld, AnimCF("Walking", AnimAng[4]), CF(), Sine, 0.15)
- else
- if (not LWeld:FindFirstChild("TweenCode"))
- and (not RWeld:FindFirstChild("TweenCode"))
- and (not ABWeld:FindFirstChild("TweenCode"))
- and (not AnimWeld:FindFirstChild("TweenCode")) then
- LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_Aimed.Left
- RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_Aimed.Right
- AnimWeld.C0 = CF(0, 1, 0)
- Grip.C1 = Aimed_GripCF
- end
- end
- end
- if S.PlayerAnimations then
- wait(0.15)
- RunTween = false
- while IsWalking do
- if (not LWeld:FindFirstChild("TweenCode"))
- and (not RWeld:FindFirstChild("TweenCode"))
- and (not ABWeld:FindFirstChild("TweenCode"))
- and (not AnimWeld:FindFirstChild("TweenCode"))then
- if (not Aimed) and (not Aiming) then
- AnimWeld.C0 = AnimCF("Walking", AnimAng[3])
- AnimAng[3] = AnimAng[3] + 0.15 * StanceSway
- elseif Aimed and (not Aiming) then
- AnimWeld.C0 = AnimCF("Walking", AnimAng[4])
- AnimAng[4] = AnimAng[4] + 0.1 * StanceSway
- end
- end
- RS:wait()
- end
- AnimAng[3], AnimAng[4] = 0, 0
- end
- end
- if IsRunning then
- Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
- UDim2.new(0, 200, 0, 200),
- UDim2.new(0, -100, 0, -100),
- Enum.EasingDirection.Out,
- Enum.EasingStyle.Linear,
- S.PlayerAnimations and 0.15 or 0,
- true
- )
- local LArmCF = CF(0, 0.7 - (SIN(AnimAng[5]) + 1)/15, 0)
- local LArmAng = CFANG(RAD(ABS(COS(AnimAng[5]))) * 10 + RAD(35), RAD(-30), RAD((SIN(AnimAng[5]) + 1) * 15 - 40))
- local RArmCF = CF(0, (SIN(AnimAng[5]) + 1)/2, 0)
- local RArmAng = CFANG(RAD(ABS(COS(AnimAng[5]))) * 10 + RAD(20), 0, RAD(50 + (SIN(AnimAng[5]) + 1) * 5))
- if S.PlayerAnimations then
- TweenJoint(LWeld, ArmC0[1], LArmCF * LArmAng, Sine, 0.15)
- TweenJoint(RWeld, ArmC0[2], RArmCF * RArmAng, Sine, 0.15)
- TweenJoint(AnimWeld, AnimCF("Running", AnimAng[5]), CF(), Sine, 0.15)
- TweenJoint(Grip, Grip.C0, CFANG(0, RAD(-5), 0), Sine, 0.15)
- else
- LWeld.C0, LWeld.C1 = ArmC0[1], LArmCF * LArmAng
- RWeld.C0, RWeld.C1 = ArmC0[2], RArmCF * RArmAng
- AnimWeld.C0 = CF(0, 0.9, 0)
- Grip.C1 = CFANG(0, RAD(-5), 0)
- end
- if S.PlayerAnimations then
- RunTween = true
- wait(0.15)
- while IsRunning do
- if (not Aiming) then
- AnimWeld.C0 = AnimCF("Running", AnimAng[5])
- AnimAng[5] = AnimAng[5] + 0.18
- end
- RS:wait()
- end
- AnimAng[5] = 0
- end
- end
- RS:wait()
- end
- end)
- end
- --------------------------------------------------------------------------------------
- --------------------[ GUN SETUP ]-----------------------------------------------------
- --------------------------------------------------------------------------------------
- Gun.Name = S.GunName
- Gun.ToolTip = S.Description
- --------------------------------------------------------------------------------------
- --------------------[ PRE-CONNECTIONS ]-----------------------------------------------
- --------------------------------------------------------------------------------------
- RS:connect(function()
- local Forward = (Keys["w"] or Keys[string.char(17)])
- local Backward = (Keys["s"] or Keys[string.char(18)])
- local Right = (Keys["d"] or Keys[string.char(19)])
- local Left = (Keys["a"] or Keys[string.char(20)])
- if (Forward or Backward or Right or Left) then
- Walking, Idleing = true, false
- elseif (not (Forward and Backward and Right and Left)) then
- Walking, Idleing = false, true
- end
- end)
- M2.KeyDown:connect(function(Key) Keys[Key] = true end)
- M2.KeyUp:connect(function(Key) Keys[Key] = false end)
- --------------------------------------------------------------------------------------
- --------------------[ WELDING ]-------------------------------------------------------
- --------------------------------------------------------------------------------------
- spawn(function()
- for _, v in pairs(Gun:GetChildren()) do
- if v:IsA("BasePart") and v ~= Handle then
- if v:FindFirstChild("MainWeld") then v.MainWeld:Destroy() end
- if (not v:FindFirstChild("WeldCF")) then
- local WeldCF = Instance.new("CFrameValue")
- WeldCF.Name = "WeldCF"
- WeldCF.Value = Handle.CFrame:toObjectSpace(v.CFrame)
- WeldCF.Parent = v
- end
- INSERT(Parts, {Obj = v, Weld = nil})
- v.Anchored = false
- end
- end
- Handle.Anchored = false
- end)
- --------------------------------------------------------------------------------------
- --------------------[ MAIN PROGRAM ]--------------------------------------------------
- --------------------------------------------------------------------------------------
- --------------------[ ARM CREATION FUNCTION ]-----------------------------------------
- function CreateArms()
- local Arms = {}
- for i = 0, 1 do
- local ArmModel = Instance.new("Model")
- ArmModel.Name = "ArmModel"
- local Arm = Instance.new("Part")
- Arm.BrickColor = (S.FakeArmRealBodyColor and (i == 0 and LArm.BrickColor or RArm.BrickColor) or S.FakeArmColor)
- Arm.Transparency = S.FakeArmTransparency
- Arm.Name = "Arm"
- Arm.CanCollide = false
- Arm.Size = VEC3(1, 2, 1)
- Arm.Parent = ArmModel
- local ArmMesh = Instance.new("SpecialMesh")
- ArmMesh.MeshId = "rbxasset://fonts//rightarm.mesh"
- ArmMesh.MeshType = Enum.MeshType.FileMesh
- ArmMesh.Scale = VEC3(0.65, 1, 0.65)
- ArmMesh.Parent = Arm
- local Sleeve1 = Instance.new("Part")
- Sleeve1.BrickColor = BrickColor.new("Sand green")
- Sleeve1.Name = "Sleeve1"
- Sleeve1.CanCollide = false
- Sleeve1.Size = VEC3(1, 2, 1)
- Sleeve1.Parent = ArmModel
- local Sleeve1Mesh = Instance.new("BlockMesh")
- Sleeve1Mesh.Offset = VEC3(0, 0.66, 0)
- Sleeve1Mesh.Scale = VEC3(0.656, 0.35, 0.656)
- Sleeve1Mesh.Parent = Sleeve1
- local Sleeve1Weld = Instance.new("Weld")
- Sleeve1Weld.Part0 = Arm
- Sleeve1Weld.Part1 = Sleeve1
- Sleeve1Weld.Parent = Arm
- local Sleeve2 = Instance.new("Part")
- Sleeve2.BrickColor = BrickColor.new("Sand green")
- Sleeve2.Name = "Sleeve2"
- Sleeve2.CanCollide = false
- Sleeve2.Size = VEC3(1, 2, 1)
- Sleeve2.Parent = ArmModel
- local Sleeve2Mesh = Instance.new("BlockMesh")
- Sleeve2Mesh.Offset = VEC3(0, 0.46, 0)
- Sleeve2Mesh.Scale = VEC3(0.75, 0.1, 0.75)
- Sleeve2Mesh.Parent = Sleeve2
- local Sleeve2Weld = Instance.new("Weld")
- Sleeve2Weld.Part0 = Arm
- Sleeve2Weld.Part1 = Sleeve2
- Sleeve2Weld.Parent = Arm
- local Glove1 = Instance.new("Part")
- Glove1.BrickColor = BrickColor.new("Black")
- Glove1.Name = "Glove1"
- Glove1.CanCollide = false
- Glove1.Size = VEC3(1, 2, 1)
- Glove1.Parent = ArmModel
- local Glove1Mesh = Instance.new("BlockMesh")
- Glove1Mesh.Offset = VEC3(0, -0.4, 0)
- Glove1Mesh.Scale = VEC3(0.657, 0.205, 0.657)
- Glove1Mesh.Parent = Glove1
- local Glove1Weld = Instance.new("Weld")
- Glove1Weld.Part0 = Arm
- Glove1Weld.Part1 = Glove1
- Glove1Weld.Parent = Arm
- local Glove2 = Instance.new("Part")
- Glove2.BrickColor = BrickColor.new("Black")
- Glove2.Name = "Glove2"
- Glove2.CanCollide = false
- Glove2.Size = VEC3(1, 2, 1)
- Glove2.Parent = ArmModel
- local Glove2Mesh = Instance.new("BlockMesh")
- Glove2Mesh.Offset = VEC3(0, -0.335, 0)
- Glove2Mesh.Scale = VEC3(0.69, 0.105, 0.69)
- Glove2Mesh.Parent = Glove2
- local Glove2Weld = Instance.new("Weld")
- Glove2Weld.Part0 = Arm
- Glove2Weld.Part1 = Glove2
- Glove2Weld.Parent = Arm
- local Glove3 = Instance.new("Part")
- Glove3.BrickColor = BrickColor.new("Black")
- Glove3.Name = "Glove3"
- Glove3.CanCollide = false
- Glove3.Size = VEC3(1, 2, 1)
- Glove3.Parent = ArmModel
- local Glove3Mesh = Instance.new("BlockMesh")
- Glove3Mesh.Offset = VEC3(0.2 * ((i * 2) - 1), -0.8, 0)
- Glove3Mesh.Scale = VEC3(0.257, 0.205, 0.657)
- Glove3Mesh.Parent = Glove3
- local Glove3Weld = Instance.new("Weld")
- Glove3Weld.Part0 = Arm
- Glove3Weld.Part1 = Glove3
- Glove3Weld.Parent = Arm
- table.insert(Arms, {Model = ArmModel, ArmPart = Arm})
- end
- return Arms
- end
- --------------------[ MATH FUNCTIONS ]------------------------------------------------
- function NumLerp(A, B, Alpha)
- return (A + ((B - A) * Alpha))
- end
- function RAND(Min, Max, Accuracy)
- local Inverse = 1 / (Accuracy or 1)
- return (math.random(Min * Inverse, Max * Inverse) / Inverse)
- end
- --------------------[ TWEEN FUNCTIONS ]-----------------------------------------------
- function TweenJoint(Joint, NewC0, NewC1, Alpha, Duration)
- coroutine.resume(coroutine.create(function()
- local TweenIndicator = nil --At the current moment, this is how the script determines whether the function is already tweening a joint
- local NewCode = math.random(-1e9, 1e9) --This creates a random code between -1000000000 and 1000000000
- if (not Joint:FindFirstChild("TweenCode")) then --If the joint isn't being tweened, then
- TweenIndicator = Instance.new("IntValue")
- TweenIndicator.Name = "TweenCode"
- TweenIndicator.Value = NewCode
- TweenIndicator.Parent = Joint
- else
- TweenIndicator = Joint.TweenCode
- TweenIndicator.Value = NewCode --If the joint is already being tweened, this will change the code, and the tween loop will stop
- end
- local MatrixCFrame = function(CFPos, CFTop, CFBack)
- local CFRight = CFTop:Cross(CFBack)
- return CF(
- CFPos.x, CFPos.y, CFPos.z,
- CFRight.x, CFTop.x, CFBack.x,
- CFRight.y, CFTop.y, CFBack.y,
- CFRight.z, CFTop.z, CFBack.z
- )
- end
- local LerpCF = function(StartCF, EndCF, Alpha)
- local StartTop = (StartCF * CFANG(RAD(90), 0, 0)).lookVector
- local StartBack = -StartCF.lookVector
- local EndTop = (EndCF * CFANG(RAD(90), 0, 0)).lookVector
- local EndBack = -EndCF.lookVector
- local StartPos = StartCF.p
- local EndPos = EndCF.p
- local NewCF = MatrixCFrame(
- StartPos:lerp(EndPos, Alpha),
- StartTop:lerp(EndTop, Alpha),
- StartBack:lerp(EndBack, Alpha)
- )
- return NewCF
- end
- local StartC0 = Joint.C0
- local StartC1 = Joint.C1
- local X = 0
- while true do
- local NewX = X + math.min(1.5 / math.max(Duration, 0), 90)
- X = (NewX > 90 and 90 or NewX)
- if TweenIndicator.Value ~= NewCode then break end --This makes sure that another tween wasn't called on the same joint
- if (not Selected) then break end --This stops the tween if the tool is deselected
- if NewC0 then Joint.C0 = LerpCF(StartC0, NewC0, Alpha(X)) end
- if NewC1 then Joint.C1 = LerpCF(StartC1, NewC1, Alpha(X)) end
- if X == 90 then break end
- RS:wait() --This makes the for loop step every 1/60th of a second
- end
- if TweenIndicator.Value == NewCode then --If this tween functions was the last one called on a joint then it will remove the code
- TweenIndicator:Destroy()
- end
- end))
- end
- function RotCamera(RotX, RotY, SmoothRot, Duration)
- spawn(function()
- if SmoothRot then
- local TweenIndicator = nil
- local NewCode = math.random(-1e9, 1e9)
- if (not Camera:FindFirstChild("TweenCode")) then
- TweenIndicator = Instance.new("IntValue")
- TweenIndicator.Name = "TweenCode"
- TweenIndicator.Value = NewCode
- TweenIndicator.Parent = Camera
- else
- TweenIndicator = Camera.TweenCode
- TweenIndicator.Value = NewCode
- end
- local Step = math.min(1.5 / math.max(Duration, 0), 90)
- local X = 0
- while true do
- local NewX = X + Step
- X = (NewX > 90 and 90 or NewX)
- if TweenIndicator.Value ~= NewCode then break end
- if (not Selected) then break end
- local CamRot = Camera.CoordinateFrame - Camera.CoordinateFrame.p
- local CamDist = (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude
- local NewCamCF = CF(Camera.Focus.p) * CamRot * CFANG(RotX / (90 / Step), RotY / (90 / Step), 0)
- Camera.CoordinateFrame = CF(NewCamCF.p, NewCamCF.p + NewCamCF.lookVector) * CF(0, 0, CamDist)
- if X == 90 then break end
- RS:wait()
- end
- if TweenIndicator.Value == NewCode then
- TweenIndicator:Destroy()
- end
- else
- local CamRot = Camera.CoordinateFrame - Camera.CoordinateFrame.p
- local CamDist = (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude
- local NewCamCF = CF(Camera.Focus.p) * CamRot * CFANG(RotX, RotY, 0)
- Camera.CoordinateFrame = CF(NewCamCF.p, NewCamCF.p + NewCamCF.lookVector) * CF(0, 0, CamDist)
- end
- end)
- end
- --------------------[ GUI SETUP FUNCTION ]--------------------------------------------
- function ConvertKey(Key)
- if Key == string.char(8) then
- return "BKSPCE"
- elseif Key == string.char(9) then
- return "TAB"
- elseif Key == string.char(13) then
- return "ENTER"
- elseif Key == string.char(17) then
- return "UP"
- elseif Key == string.char(18) then
- return "DOWN"
- elseif Key == string.char(19) then
- return "RIGHT"
- elseif Key == string.char(20) then
- return "LEFT"
- elseif Key == string.char(22) then
- return "HOME"
- elseif Key == string.char(23) then
- return "END"
- elseif Key == string.char(27) then
- return "F2"
- elseif Key == string.char(29) then
- return "F4"
- elseif Key == string.char(30) then
- return "F5"
- elseif Key == string.char(32) or Key == " " then
- return "F7"
- elseif Key == string.char(33) or Key == "!" then
- return "F8"
- elseif Key == string.char(34) or Key == '"' then
- return "F9"
- elseif Key == string.char(35) or Key == "#" then
- return "F10"
- elseif Key == string.char(37) or Key == "%" then
- return "F12"
- elseif Key == string.char(47) or Key == "/" then
- return "R-SHIFT"
- elseif Key == string.char(48) or Key == "0" then
- return "L-SHIFT"
- elseif Key == string.char(49) or Key == "1" then
- return "R-CTRL"
- elseif Key == string.char(50) or Key == "2" then
- return "L-CTRL"
- elseif Key == string.char(51) or Key == "3" then
- return "R-ALT"
- elseif Key == string.char(52) or Key == "4" then
- return "L-ALT"
- else
- return string.upper(Key)
- end
- end
- function CreateControlFrame(Key, Desc, Num)
- local Controls = Gui_Clone:WaitForChild("HUD"):WaitForChild("Controls")
- local C = Instance.new("Frame")
- C.BackgroundTransparency = ((Num % 2) == 1 and 0.7 or 1)
- C.BorderSizePixel = 0
- C.Name = "C"..Num
- C.Position = UDim2.new(0, 0, 0, Num * 20)
- C.Size = UDim2.new(1, 0, 0, 20)
- local K = Instance.new("TextLabel")
- K.BackgroundTransparency = 1
- K.Name = "Key"
- K.Size = UDim2.new(0, 45, 1, 0)
- K.Font = Enum.Font.ArialBold
- K.FontSize = Enum.FontSize.Size14
- K.Text = Key
- K.TextColor3 = Color3.new(1, 1, 1)
- K.TextScaled = (string.len(Key) > 5)
- K.TextWrapped = (string.len(Key) > 5)
- K.Parent = C
- local D = Instance.new("TextLabel")
- D.BackgroundTransparency = 1
- D.Name = "Desc"
- D.Position = UDim2.new(0, 50, 0, 0)
- D.Size = UDim2.new(1, -50, 1, 0)
- D.Font = Enum.Font.ArialBold
- D.FontSize = Enum.FontSize.Size14
- D.Text = "- "..Desc
- D.TextColor3 = Color3.new(1, 1, 1)
- D.TextXAlignment = Enum.TextXAlignment.Left
- D.Parent = C
- C.Parent = Controls
- end
- function SetUpGui()
- local HUD = Gui_Clone:WaitForChild("HUD")
- local Scope = Gui_Clone:WaitForChild("Scope")
- local Grenades = HUD:WaitForChild("Grenades")
- local Controls = HUD:WaitForChild("Controls")
- local CurrentNum = 1
- if S.CanChangeStance then
- local Dive = (S.DolphinDive and " / Dive" or "")
- CreateControlFrame(ConvertKey(S.LowerStanceKey), "Lower Stance"..Dive, CurrentNum)
- CurrentNum = CurrentNum + 1
- CreateControlFrame(ConvertKey(S.RaiseStanceKey), "Raise Stance", CurrentNum)
- CurrentNum = CurrentNum + 1
- end
- CreateControlFrame(ConvertKey(S.ReloadKey), "Reload", CurrentNum)
- CurrentNum = CurrentNum + 1
- if S.CanKnife then
- CreateControlFrame(ConvertKey(S.KnifeKey), "Knife", CurrentNum)
- CurrentNum = CurrentNum + 1
- end
- if S.Throwables then
- CreateControlFrame(ConvertKey(S.LethalGrenadeKey), "Throw Lethal", CurrentNum)
- CurrentNum = CurrentNum + 1
- CreateControlFrame(ConvertKey(S.TacticalGrenadeKey), "Throw Tactical", CurrentNum)
- CurrentNum = CurrentNum + 1
- else
- Grenades.Visible = false
- HUD.Position = UDim2.new(1, -200, 1, -100)
- HUD.Size = UDim2.new(0, 175, 0, 50)
- end
- CreateControlFrame(ConvertKey(S.SprintKey), "Sprint", CurrentNum)
- CurrentNum = CurrentNum + 1
- if S.ADSKey ~= "" then
- local Hold = (S.HoldMouseOrKeyToADS and "HOLD " or "")
- CreateControlFrame(Hold..ConvertKey(S.ADSKey).." OR R-MOUSE", "Aim Down Sights", CurrentNum)
- CurrentNum = CurrentNum + 1
- end
- Controls.Size = UDim2.new(1, 0, 0, CurrentNum * 20)
- Controls.Position = UDim2.new(0, 0, 0, -(CurrentNum * 20) - 80)
- if S.GuiScope then
- Scope:WaitForChild("Img").Image = S.GuiId
- Scope:WaitForChild("Steady").Text = "Hold "..ConvertKey(S.ScopeSteadyKey).." to Steady"
- end
- if HUD:FindFirstChild("Co") then
- HUD.Co:Destroy()
- end
- local Co = Instance.new("TextLabel")
- Co.BackgroundTransparency = 1
- Co.Name = "Co"
- Co.Position = UDim2.new(0, 0, 1, 5)
- Co.Size = UDim2.new(1, 0, 0, 20)
- Co.Font = Enum.Font.ArialBold
- Co.FontSize = Enum.FontSize.Size14
- Co.Text = ("noisuFobruT yb detpircs tiK nuG"):reverse()
- Co.TextColor3 = Color3.new(1, 1, 0)
- Co.TextStrokeTransparency = 0
- Co.TextXAlignment = Enum.TextXAlignment.Right
- Co.Parent = HUD
- HUD:WaitForChild("Grenades"):WaitForChild("Lethals"):WaitForChild("Icon").Image = LethalIcons[S.LethalGrenadeType]
- HUD:WaitForChild("Grenades"):WaitForChild("Tacticals"):WaitForChild("Icon").Image = TacticalIcons[S.TacticalGrenadeType]
- end
- --------------------[ FIRING FUNCTIONS ]----------------------------------------------
- function Fire_Gun()
- local FireSound = Handle:FindFirstChild("FireSound")
- local FlashGui = Main:FindFirstChild("FlashGui")
- local FlashFX = Main:FindFirstChild("FlashFX")
- if FireSound then FireSound:Play() end
- local MockSpread = (
- ((not Aimed) and CurrentSpread <= S.Spread.Max and Idleing)
- and CurrentSpread * S.Spread.Multiplier or CurrentSpread
- )
- CurrentSpread = (MockSpread >= S.Spread.Max and S.Spread.Max or MockSpread)
- ----------------------------------------------------------------------------------
- for _ = 1, (S.GunType.Shot and S.ShotAmount or 1) do
- local BSpread = CFANG(
- RAD(RAND(-CurrentSpread, CurrentSpread) / 20),
- RAD(RAND(-CurrentSpread, CurrentSpread) / 20),
- RAD(RAND(-CurrentSpread, CurrentSpread) / 20)
- )
- local OriginCF = (Aimed and (S.GuiScope and Head.CFrame or Handle.CFrame) or Head.CFrame)
- local OriginPos = Main.CFrame.p
- local Direction = (CF(OriginCF.p, OriginCF.p + OriginCF.lookVector) * BSpread).lookVector
- if S.InstantHit then
- local HitObj, HitPos = AdvRayCast(Main.CFrame.p, Direction, S.BulletRange)
- local HitHumanoid = nil
- if HitObj then
- if S.GunType.Explosive then
- if S.ExplosionSound ~= "" then
- local SoundPart = Instance.new("Part")
- SoundPart.Transparency = 1
- SoundPart.Anchored = true
- SoundPart.CanCollide = false
- SoundPart.CFrame = CFrame.new(HitPos)
- SoundPart.Parent = game.Workspace
- local Sound = Instance.new("Sound")
- Sound.Pitch = S.ExplosionSoundPitch
- Sound.SoundId = S.ExplosionSound
- Sound.Volume = S.ExplosionSoundVolume
- Sound.Parent = SoundPart
- Sound:Play()
- delay(1 / 20, function()
- SoundPart:Destroy()
- end)
- end
- CreateBulletHole(HitPos, HitObj)
- CreateShockwave(HitPos, S.ExplosionRadius)
- local E = Instance.new("Explosion")
- E.BlastPressure = S.ExplosionPressure
- E.BlastRadius = S.ExplosionRadius
- E.DestroyJointRadiusPercent = (S.RangeBasedDamage and 0 or 1)
- E.ExplosionType = S.ExplosionType
- E.Position = HitPos
- E.Hit:connect(function(HObj, HDist)
- if HObj.Name == "Torso" and (not HObj:IsDescendantOf(Character)) then
- if S.RangeBasedDamage then
- local Dir = (HObj.Position - HitPos).unit
- local H, P = AdvRayCast(HitPos - Dir, Dir, 999)
- local RayHitHuman = H:IsDescendantOf(HObj.Parent)
- if (S.RayCastExplosions and RayHitHuman) or (not S.RayCastExplosions) then
- local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
- if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
- local DistFactor = HDist / S.ExplosionRadius
- local DistInvert = math.max(1 - DistFactor,0)
- local NewDamage = DistInvert * S.Damage
- local CreatorTag = Instance.new("ObjectValue")
- CreatorTag.Value = Player
- CreatorTag.Name = "creator"
- CreatorTag.Parent = HitHumanoid
- HitHumanoid:TakeDamage(NewDamage)
- MarkHit()
- end
- end
- else
- local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
- if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
- local CreatorTag = Instance.new("ObjectValue")
- CreatorTag.Value = Player
- CreatorTag.Name = "creator"
- CreatorTag.Parent = HitHumanoid
- MarkHit()
- end
- end
- end
- end)
- E.Parent = game.Workspace
- else
- HitHumanoid = Damage(HitObj, HitPos)
- end
- end
- local FinalHitPos = HitPos
- if S.Penetration > 0 and (not S.GunType.Explosive) then
- FinalHitPos = PenetrateWall(HitPos, Direction, HitHumanoid, OriginPos)
- end
- if S.BulletTrail and S.TrailTransparency ~= 1 then
- local Trail = Instance.new("Part")
- Trail.BrickColor = S.TrailColor
- Trail.Transparency = S.TrailTransparency
- Trail.Anchored = true
- Trail.CanCollide = false
- Trail.Size = VEC3(1, 1, 1)
- local Mesh = Instance.new("BlockMesh")
- Mesh.Offset = VEC3(0, 0, -(FinalHitPos - OriginPos).magnitude / 2)
- Mesh.Scale = VEC3(S.TrailThickness, S.TrailThickness, (FinalHitPos - OriginPos).magnitude)
- Mesh.Parent = Trail
- Trail.Parent = Gun_Ignore
- Trail.CFrame = CF(OriginPos, FinalHitPos)
- delay(S.TrailVisibleTime, function()
- if S.TrailDisappearTime > 0 then
- local X = 0
- while true do
- if X == 90 then break end
- if (not Selected) then break end
- local NewX = X + (1.5 / S.TrailDisappearTime)
- X = (NewX > 90 and 90 or NewX)
- local Alpha = X / 90
- Trail.Transparency = NumLerp(S.TrailTransparency, 1, Alpha)
- RS:wait()
- end
- Trail:Destroy()
- else
- Trail:Destroy()
- end
- end)
- end
- else
- local Bullet = CreateBullet(Direction)
- local LastPos = Main.CFrame.p
- local TotalDistTraveled = 0
- local HitHumanoid = nil
- spawn(function()
- while true do
- RS:wait()
- if TotalDistTraveled >= S.BulletRange then
- Bullet:Destroy()
- break
- end
- local DistTraveled = (Bullet.Position - LastPos).magnitude
- local HitObj, HitPos = AdvRayCast(LastPos, (Bullet.Position - LastPos).unit, DistTraveled)
- if HitObj then
- if S.GunType.Explosive then
- if S.ExplosionSound ~= "" then
- local Sound = Instance.new("Sound")
- Sound.Pitch = S.ExplosionSoundPitch
- Sound.SoundId = S.ExplosionSound
- Sound.Volume = S.ExplosionSoundVolume
- Sound.Parent = Bullet
- Sound:Play()
- end
- CreateBulletHole(HitPos, HitObj)
- CreateShockwave(HitPos, S.ExplosionRadius)
- local E = Instance.new("Explosion")
- E.BlastPressure = S.ExplosionPressure
- E.BlastRadius = S.ExplosionRadius
- E.DestroyJointRadiusPercent = (S.RangeBasedDamage and 0 or 1)
- E.ExplosionType = S.ExplosionType
- E.Position = HitPos
- E.Hit:connect(function(HObj, HDist)
- if HObj.Name == "Torso" and (not HObj:IsDescendantOf(Character)) then
- if S.RangeBasedDamage then
- local Dir = (HObj.Position - HitPos).unit
- local H, P = AdvRayCast(HitPos - Dir, Dir, 999)
- local RayHitHuman = H:IsDescendantOf(HObj.Parent)
- if (S.RayCastExplosions and RayHitHuman) or (not S.RayCastExplosions) then
- local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
- if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
- local DistFactor = HDist / S.ExplosionRadius
- local DistInvert = math.max(1 - DistFactor,0)
- local NewDamage = DistInvert * S.Damage
- local CreatorTag = Instance.new("ObjectValue")
- CreatorTag.Value = Player
- CreatorTag.Name = "creator"
- CreatorTag.Parent = HitHumanoid
- HitHumanoid:TakeDamage(NewDamage)
- MarkHit()
- end
- end
- else
- local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
- if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
- local CreatorTag = Instance.new("ObjectValue")
- CreatorTag.Value = Player
- CreatorTag.Name = "creator"
- CreatorTag.Parent = HitHumanoid
- MarkHit()
- end
- end
- end
- end)
- E.Parent = game.Workspace
- else
- HitHumanoid = Damage(HitObj, HitPos)
- end
- if S.Penetration > 0 and (not S.GunType.Explosive) then
- PenetrateWall(HitPos, (Bullet.Position - LastPos).unit, HitHumanoid, OriginPos, Bullet)
- else
- Bullet:Destroy()
- end
- break
- else
- LastPos = Bullet.Position
- TotalDistTraveled = TotalDistTraveled + DistTraveled
- end
- end
- end)
- if S.BulletTrail and S.TrailTransparency ~= 1 then
- spawn(function()
- local LastPos2 = nil
- while true do
- if LastPos2 then
- if (not Bullet:IsDescendantOf(game)) then break end
- Bullet.CFrame = CFrame.new(Bullet.CFrame.p, Bullet.CFrame.p + Bullet.Velocity)
- local Trail = Instance.new("Part")
- Trail.BrickColor = S.TrailColor
- Trail.Transparency = S.TrailTransparency
- Trail.Anchored = true
- Trail.CanCollide = false
- Trail.Size = VEC3(1, 1, 1)
- local Mesh = Instance.new("BlockMesh")
- Mesh.Offset = VEC3(0, 0, -(Bullet.Position - LastPos2).magnitude / 2)
- Mesh.Scale = VEC3(S.TrailThickness, S.TrailThickness, (Bullet.Position - LastPos2).magnitude)
- Mesh.Parent = Trail
- Trail.Parent = Gun_Ignore
- Trail.CFrame = CF(LastPos2, Bullet.Position)
- delay(S.TrailVisibleTime, function()
- if S.TrailDisappearTime > 0 then
- local X = 0
- while true do
- if X == 90 then break end
- if (not Selected) then break end
- local NewX = X + (1.5 / S.TrailDisappearTime)
- X = (NewX > 90 and 90 or NewX)
- local Alpha = X / 90
- Trail.Transparency = NumLerp(S.TrailTransparency, 1, Alpha)
- RS:wait()
- end
- Trail:Destroy()
- else
- Trail:Destroy()
- end
- end)
- LastPos2 = Bullet.Position
- else
- LastPos2 = Main.CFrame.p
- end
- RS:wait()
- end
- end)
- end
- end
- end
- ----------------------------------------------------------------------------------
- local RecoilX = RAD(CurrentRecoil * RAND(1, 1.5, 0.1)) * StanceSway
- local RecoilY = RAD(CurrentRecoil * RAND(-2, 2, 0.1)) * StanceSway
- RotCamera(RecoilX, RecoilY, true, 0.06)
- delay(0.05, function()
- RotCamera(-RecoilX / 5, -RecoilY / 5, true, 0.1)
- end)
- if Idleing and (not Walking) and (not Aimed) then
- local SpreadScale = (CurrentSpread / S.Spread.Max) * 50
- Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
- UDim2.new(0, 70 + 2 * SpreadScale, 0, 70 + 2 * SpreadScale),
- UDim2.new(0, -35 - SpreadScale, 0, -35 - SpreadScale),
- "Out", "Linear", 0.1, true
- )
- end
- local KickSide = (
- (
- {
- CurrentRecoil * (RAND(1, 5, 1) / 150);
- CurrentRecoil * (RAND(1, 5, 1) / -150)
- }
- )[math.random(1, 2)]
- ) * StanceSway
- local KickBack = CurrentRecoil * StanceSway * 0.3
- local KickUp = RAD(90 + (CurrentRecoil * RAND(1.3, 1.4, 0.01) * StanceSway))
- TweenJoint(AnimWeld, CF(KickSide, 1, -KickBack), CFANG(KickUp - RAD(90), 0, 0), Linear, 1 / 12)
- if FlashFX then FlashFX.Enabled = true end
- if FlashGui then
- FlashGui.Enabled = true
- FlashGui.Label.Rotation = RAND(0, 360)
- end
- delay(1 / 30, function()
- if Idleing and (not Walking) and (not Aimed) then
- Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
- UDim2.new(0, 70, 0, 70),
- UDim2.new(0, -35, 0, -35),
- "Out", "Linear", S.AimSpeed, (not Aimed)
- )
- end
- if (not Aiming) and (not RunTween) then
- TweenJoint(AnimWeld, CF(0, 1, 0), CF(), Linear, 0.15)
- end
- if FlashFX then FlashFX.Enabled = false end
- if FlashGui then FlashGui.Enabled = false end
- end)
- end
- function MarkHit()
- spawn(function()
- if Gui_Clone:IsDescendantOf(game) then
- Gui_Clone.HitMarker.Visible = true
- local StartMark = tick()
- LastMark = StartMark
- wait(0.5)
- if LastMark <= StartMark then
- Gui_Clone.HitMarker.Visible = false
- end
- end
- end)
- end
- --------------------[ ADS FUNCTIONS ]-------------------------------------------------
- function AimGun()
- if (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude > 1 or Reloading or Knifing or ThrowingGrenade then return end
- local Scope = Gui_Clone:WaitForChild("Scope"):WaitForChild("Img")
- local Steady = Gui_Clone:WaitForChild("Scope"):WaitForChild("Steady")
- Aimed = true
- Aiming = true
- CurrentRecoil = S.Recoil.Aimed
- CurrentSpread = S.Spread.Aimed
- Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
- UDim2.new(),
- UDim2.new(),
- Enum.EasingDirection.Out,
- Enum.EasingStyle.Sine,
- S.AimAnimation and S.AimSpeed or 0,
- true
- )
- if S.AimAnimation then
- local CurrentFOV = Camera.FieldOfView
- local CurrentCameraOffset = Humanoid.CameraOffset
- local CurrentTrans = Scope.BackgroundTransparency
- TweenJoint(LWeld, ArmC0[1], S.ArmC1_Aimed.Left, Sine, S.AimSpeed)
- TweenJoint(RWeld, ArmC0[2], S.ArmC1_Aimed.Right, Sine, S.AimSpeed)
- TweenJoint(AnimWeld, CF(0, 1, 0), CF(), Sine, S.AimSpeed)
- TweenJoint(Grip, Grip.C0, Aimed_GripCF, Sine, S.AimSpeed)
- TweenJoint(LWeld2, CF(), CF(), Sine, S.AimSpeed)
- TweenJoint(RWeld2, CF(), CF(), Sine, S.AimSpeed)
- local X = 0
- while true do
- local NewX = X + 1.5 / S.AimSpeed
- X = (NewX > 90 and 90 or NewX)
- if (not Aimed) then break end
- if (not Selected) then break end
- local Alpha = 1 - COS(RAD(X))
- Camera.FieldOfView = NumLerp(CurrentFOV, S.MaxZoom, Alpha)
- if S.GuiScope then
- Scope.BackgroundTransparency = NumLerp(CurrentTrans, 0, Alpha)
- end
- if X == 90 then break end
- RS:wait()
- end
- else
- LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_Aimed.Left
- RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_Aimed.Right
- AnimWeld.C0 = CF(0, 1, 0)
- Grip.C1 = Aimed_GripCF
- LWeld2.C1, RWeld2.C1 = CF(), CF()
- Camera.FieldOfView = S.MaxZoom
- end
- Aiming = (not Aimed)
- if (not Aiming) and S.GuiScope then
- spawn(function()
- Steady.Visible = true
- Scope.BackgroundTransparency = 1
- Scope.ImageTransparency = 0
- local Gun_Model = Instance.new("Model")
- Gun_Model.Name = "Gun_Model"
- for _, Obj in pairs(Gun:GetChildren()) do
- if Obj:IsA("BasePart") then
- local ObjClone = Obj:Clone()
- ObjClone.Parent = Gun_Model
- local W = Instance.new("Weld")
- W.Part0 = ObjClone
- W.Part1 = Obj
- W.Parent = ObjClone
- local PrevTrans = Instance.new("NumberValue")
- PrevTrans.Name = "PrevTrans"
- PrevTrans.Value = Obj.Transparency
- PrevTrans.Parent = Obj
- Obj.Transparency = 1
- end
- end
- Gun_Model.Parent = Character
- end)
- spawn(function()
- while Aimed do
- local Ang = (CameraSteady and 0 or (Idleing and AnimAng[2] or AnimAng[4]))
- if CameraSway ~= 0 then
- local OffsetX, OffsetY = 0, 0
- if Idleing then
- OffsetX = (RAD(COS(Ang * 5 * (CameraSway ^ 0.4))) / 40) * (CameraSway ^ 1.2) * StanceSway * S.ScopeSway
- OffsetY = (RAD(COS(Ang * 2 * (CameraSway ^ 0.4))) / 40) * (CameraSway ^ 1.2) * StanceSway * S.ScopeSway
- else
- OffsetX = (RAD(COS(Ang * 3/2 * (CameraSway ^ 0.4))) / 25) * (CameraSway ^ 1.2) * StanceSway * S.ScopeSway
- OffsetY = (RAD(COS(Ang * 3/5 * (CameraSway ^ 0.4))) / 25) * (CameraSway ^ 1.2) * StanceSway * S.ScopeSway
- end
- RotCamera(OffsetX, OffsetY)
- end
- RS:wait()
- end
- end)
- end
- end
- function UnAimGun(Exception)
- local Scope = Gui_Clone:WaitForChild("Scope"):WaitForChild("Img")
- local Steady = Gui_Clone:WaitForChild("Scope"):WaitForChild("Steady")
- if (not Exception) then
- if (not Aimed) then return end
- if (Reloading and Exception) or Knifing and (not ThrowingGrenade) then return end
- CurrentRecoil = S.Recoil.Hipfire
- CurrentSpread = ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
- if Walking and Aimed then
- Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
- UDim2.new(0, 150, 0, 150),
- UDim2.new(0, -75, 0, -75),
- Enum.EasingDirection.Out,
- Enum.EasingStyle.Linear,
- S.AimAnimation and S.AimSpeed or 0,
- true
- )
- elseif Idleing then
- Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
- UDim2.new(0, 70, 0, 70),
- UDim2.new(0, -35, 0, -35),
- Enum.EasingDirection.Out,
- Enum.EasingStyle.Linear,
- S.AimAnimation and S.AimSpeed or 0,
- true
- )
- end
- Aimed = false
- Aiming = true
- if S.GuiScope then
- spawn(function()
- local Gun_Model = Character:FindFirstChild("Gun_Model")
- if Gun_Model then
- Gun_Model:Destroy()
- end
- for _, Obj in pairs(Gun:GetChildren()) do
- if Obj:IsA("BasePart") then
- local PrevTrans = Obj:FindFirstChild("PrevTrans")
- Obj.Transparency = PrevTrans.Value
- PrevTrans:Destroy()
- end
- end
- end)
- end
- if S.AimAnimation then
- local CurrentFOV = Camera.FieldOfView
- local CurrentCameraOffset = Humanoid.CameraOffset
- local CurrentTrans = (Scope.BackgroundTransparency == 1 and (S.GuiScope and 0 or 1) or Scope.BackgroundTransparency)
- Scope.ImageTransparency = 1
- Steady.Visible = false
- TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Sine, S.AimSpeed)
- TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Sine, S.AimSpeed)
- TweenJoint(Grip, Grip.C0, CFANG(0, RAD(20), 0), Sine, S.AimSpeed)
- if S.PlayerAnimations then
- TweenJoint(LWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, S.AimSpeed)
- TweenJoint(RWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, S.AimSpeed)
- end
- local X = 0
- while true do
- local NewX = X + 1.5 / S.AimSpeed
- X = (NewX > 90 and 90 or NewX)
- if Aimed then break end
- if (not Selected) then break end
- local Alpha = 1 - COS(RAD(X))
- Camera.FieldOfView = NumLerp(CurrentFOV, 70, Alpha)
- Scope.BackgroundTransparency = NumLerp(CurrentTrans, 1, Alpha)
- if X == 90 then break end
- RS:wait()
- end
- else
- Scope.BackgroundTransparency = 1
- Scope.ImageTransparency = 1
- Steady.Visible = false
- LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_UnAimed.Left
- RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_UnAimed.Right
- Grip.C1 = CFANG(0, RAD(20), 0)
- LWeld2.C1, RWeld2.C1 = CFANG(0, RAD(ArmTilt), 0), CFANG(0, RAD(ArmTilt), 0)
- Camera.FieldOfView = 70
- end
- Aiming = Aimed
- else
- if S.GuiScope then
- spawn(function()
- local Gun_Model = Character:FindFirstChild("Gun_Model")
- if Gun_Model then
- Gun_Model:Destroy()
- end
- for _, Obj in pairs(Gun:GetChildren()) do
- if Obj:IsA("BasePart") then
- local PrevTrans = Obj:FindFirstChild("PrevTrans")
- Obj.Transparency = PrevTrans.Value
- PrevTrans:Destroy()
- end
- end
- end)
- end
- spawn(function()
- Aimed = false
- Aiming = false
- CurrentRecoil = S.Recoil.Hipfire
- CurrentSpread = ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
- if (not Walking) then
- Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
- UDim2.new(0, 70, 0, 70),
- UDim2.new(0, -35, 0, -35),
- Enum.EasingDirection.Out,
- Enum.EasingStyle.Linear,
- S.AimAnimation and S.AimSpeed or 0,
- true
- )
- else
- Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
- UDim2.new(0, 150, 0, 150),
- UDim2.new(0, -75, 0, -75),
- Enum.EasingDirection.Out,
- Enum.EasingStyle.Linear,
- S.AimAnimation and S.AimSpeed or 0,
- true
- )
- end
- local CurrentFOV = Camera.FieldOfView
- local CurrentCameraOffset = Humanoid.CameraOffset
- local CurrentTrans = (Scope.BackgroundTransparency == 1 and (S.GuiScope and 0 or 1) or Scope.BackgroundTransparency)
- Scope.ImageTransparency = 1
- Steady.Visible = false
- if LWeld:FindFirstChild("TweenCode") then LWeld.TweenCode:Destroy() end
- if RWeld:FindFirstChild("TweenCode") then RWeld.TweenCode:Destroy() end
- if Grip:FindFirstChild("TweenCode") then Grip.TweenCode:Destroy() end
- if LWeld2:FindFirstChild("TweenCode") then LWeld2.TweenCode:Destroy() end
- if RWeld2:FindFirstChild("TweenCode") then RWeld2.TweenCode:Destroy() end
- if S.AimAnimation then
- local X = 0
- while true do
- local NewX = X + 1.5 / S.AimSpeed
- X = (NewX > 90 and 90 or NewX)
- if Aimed then break end
- if (not Selected) then break end
- local Alpha = 1 - COS(RAD(X))
- Camera.FieldOfView = NumLerp(CurrentFOV, 70, Alpha)
- Scope.BackgroundTransparency = NumLerp(CurrentTrans, 1, Alpha)
- if X == 90 then break end
- RS:wait()
- end
- else
- Scope.BackgroundTransparency = 1
- Scope.ImageTransparency = 1
- Steady.Visible = false
- Camera.FieldOfView = 70
- end
- end)
- end
- end
- --------------------[ TEXTURE CREATION FUNCTIONS ]------------------------------------
- function CreateBullet(Direction)
- local Origin = Gun.Main.CFrame.p
- local BulletMass = S.BulletSize.X * S.BulletSize.Y * S.BulletSize.Z
- local BulletCF = CF(Origin, Origin + Direction)
- local Bullet = Instance.new("Part")
- Bullet.BrickColor = S.BulletColor
- Bullet.Name = "Bullet"
- Bullet.CanCollide = false
- Bullet.FormFactor = "Custom"
- Bullet.Size = S.BulletSize
- Bullet.BottomSurface = "Smooth"
- Bullet.TopSurface = "Smooth"
- local Mesh = Instance.new("BlockMesh")
- Mesh.Scale = S.BulletMeshSize
- Mesh.Parent = Bullet
- local BF = Instance.new("BodyForce")
- BF.force = VEC3(0, BulletMass * (196.2 - S.BulletDropPerSecond), 0)
- BF.Parent = Bullet
- Bullet.Parent = Gun_Ignore
- Bullet.CFrame = BulletCF + Direction * 3
- Bullet.Velocity = Direction * S.BulletVelocity
- return Bullet
- end
- function CreateBulletHole(HitPos, HitObj)
- local SurfaceCF = GetHitSurfaceCFrame(HitPos, HitObj)
- local SurfaceDir = CF(HitObj.CFrame.p, SurfaceCF.p)
- local SurfaceDist = SurfaceDir.lookVector * (HitObj.CFrame.p - SurfaceCF.p).magnitude / 2
- local SurfaceOffset = HitPos - SurfaceCF.p + SurfaceDist
- local SurfaceCFrame = SurfaceDir + SurfaceDist + SurfaceOffset
- local HitMark = Instance.new("Part")
- HitMark.BrickColor = BrickColor.new("Black")
- HitMark.Transparency = 1
- HitMark.Anchored = true
- HitMark.CanCollide = false
- HitMark.FormFactor = "Custom"
- HitMark.Size = VEC3(1, 1, 0.2)
- HitMark.TopSurface = 0
- HitMark.BottomSurface = 0
- local Mesh = Instance.new("BlockMesh")
- Mesh.Offset = VEC3(0, 0, -0.05)
- Mesh.Scale = VEC3(S.BulletHoleSize, S.BulletHoleSize, 0)
- Mesh.Parent = HitMark
- local Decal = Instance.new("Decal")
- Decal.Face = Enum.NormalId.Front
- Decal.Texture = S.BulletHoleTexture
- Decal.Parent = HitMark
- HitMark.Parent = Gun_Ignore
- HitMark.CFrame = SurfaceCFrame
- if (not HitObj.Anchored) then
- local Weld = Instance.new("Weld", HitMark)
- Weld.Part0 = HitObj
- Weld.Part1 = HitMark
- Weld.C0 = HitObj.CFrame:toObjectSpace(SurfaceCFrame)
- HitMark.Anchored = false
- end
- delay(S.BulletHoleVisibleTime, function()
- if S.BulletHoleDisappearTime > 0 then
- local X = 0
- while true do
- if X == 90 then break end
- if (not Selected) then break end
- local NewX = X + (1.5 / S.BulletHoleDisappearTime)
- X = (NewX > 90 and 90 or NewX)
- local Alpha = X / 90
- Decal.Transparency = NumLerp(0, 1, Alpha)
- RS:wait()
- end
- HitMark:Destroy()
- else
- HitMark:Destroy()
- end
- end)
- end
- function CreateShockwave(Center, Radius)
- local Shockwave = Instance.new("Part")
- Shockwave.BrickColor = S.ShockwaveColor
- Shockwave.Material = Enum.Material.SmoothPlastic
- Shockwave.Name = "Shockwave"
- Shockwave.Anchored = true
- Shockwave.CanCollide = false
- Shockwave.FormFactor = Enum.FormFactor.Symmetric
- Shockwave.Size = VEC3(1, 1, 1)
- Shockwave.BottomSurface = Enum.SurfaceType.Smooth
- Shockwave.TopSurface = Enum.SurfaceType.Smooth
- local Mesh = Instance.new("SpecialMesh")
- Mesh.MeshType = Enum.MeshType.Sphere
- Mesh.Scale = VEC3()
- Mesh.Parent = Shockwave
- Shockwave.Parent = Gun_Ignore
- Shockwave.CFrame = CF(Center)
- spawn(function()
- for i = 0, 1, (1 / (60 * S.ShockwaveDuration)) do
- local Scale = 2 * Radius * i
- Mesh.Scale = VEC3(Scale, Scale, Scale)
- Shockwave.Transparency = i
- RS:wait()
- end
- Shockwave:Destroy()
- end)
- end
- --------------------[ HIT HANDLING FUNCTIONS ]----------------------------------------
- function Damage(HitObj, HitPos)
- local HeadVal = S.Multipliers.Head
- local ChestVal = S.Multipliers.Chest
- local LimbsVal = S.Multipliers.Limbs
- if Humanoid.Health ~= 0 then
- if HitObj and HitObj.Parent then
- local HumanoidFound = false
- local HitHumanoid = nil
- if HitObj.Parent.ClassName == "Hat" then
- if FindFirstClass(HitObj.Parent.Parent, "Humanoid") then
- HitHumanoid = FindFirstClass(HitObj.Parent.Parent, "Humanoid")
- HumanoidFound = true
- if HitHumanoid.Health > 0 then
- if IsEnemy(HitHumanoid) then
- local CreatorTag = Instance.new("ObjectValue")
- CreatorTag.Value = Player
- CreatorTag.Name = "creator"
- CreatorTag.Parent = HitHumanoid
- HitHumanoid:TakeDamage(S.Damage * RAND(HeadVal, HeadVal + 0.1, 0.01))
- MarkHit()
- end
- end
- end
- else
- if FindFirstClass(HitObj.Parent, "Humanoid") then
- HitHumanoid = FindFirstClass(HitObj.Parent, "Humanoid")
- HumanoidFound = true
- if HitHumanoid.Health > 0 then
- if IsEnemy(HitHumanoid) then
- local CreatorTag = Instance.new("ObjectValue")
- CreatorTag.Value = Player
- CreatorTag.Name = "creator"
- CreatorTag.Parent = HitHumanoid
- local ChosenDamage = 0
- if HitObj.Name == "Head" then
- ChosenDamage = S.Damage * RAND(HeadVal, HeadVal + 0.1, 0.01)
- elseif HitObj.Name == "Torso" then
- ChosenDamage = S.Damage * RAND(ChestVal, ChestVal + 0.1, 0.01)
- else
- ChosenDamage = S.Damage * RAND(LimbsVal, LimbsVal + 0.1, 0.01)
- end
- HitHumanoid:TakeDamage(ChosenDamage)
- MarkHit()
- end
- end
- end
- end
- if (not HumanoidFound) then
- if S.BulletHoles then
- CreateBulletHole(HitPos, HitObj)
- end
- if S.Shockwaves then
- CreateShockwave(HitPos, S.ShockwaveRadius)
- end
- end
- return HitHumanoid
- end
- end
- end
- function PenetrateWall(HitPos, Direction, HitHumanoid, OriginPos, Bullet)
- local HitDist = (HitPos - OriginPos).magnitude
- local Thickness, Wall, WallHitPos = 0, nil, nil
- for i = 0.1, S.Penetration, 0.1 do
- local WallRay = Ray.new(HitPos + (Direction * i), -Direction)
- local TempWall, TempWallHitPos = game.Workspace:FindPartOnRayWithIgnoreList(WallRay, Ignore)
- if TempWall then
- Thickness = i
- Wall, WallHitPos = TempWall, TempWallHitPos
- break
- end
- end
- if Wall then
- CreateBulletHole(WallHitPos, Wall)
- if S.InstantHit then
- local HitObj2, HitPos2 = nil, nil
- if HitHumanoid then
- HitObj2, HitPos2 = AdvRayCast(WallHitPos, Direction, S.BulletRange - HitDist, {HitHumanoid.Parent,unpack(Ignore)})
- else
- HitObj2, HitPos2 = AdvRayCast(WallHitPos, Direction, S.BulletRange - HitDist)
- end
- Damage(HitObj2, HitPos2)
- return HitPos2
- else
- local LastPos = WallHitPos
- local TotalDistTraveled = 0
- spawn(function()
- while true do
- RS:wait()
- if TotalDistTraveled >= S.BulletRange - HitDist then
- Bullet:Destroy()
- break
- end
- local DistTraveled = (Bullet.Position - LastPos).magnitude
- local NewDirection = (Bullet.Position - LastPos).unit
- local TempHitObj, TempHitPos = nil, nil
- if HitHumanoid then
- TempHitObj, TempHitPos = AdvRayCast(LastPos, NewDirection, DistTraveled, {HitHumanoid.Parent,unpack(Ignore)})
- else
- TempHitObj, TempHitPos = AdvRayCast(LastPos, NewDirection, DistTraveled)
- end
- if TempHitObj then
- Damage(TempHitObj, TempHitPos)
- Bullet:Destroy()
- return TempHitPos
- else
- LastPos = Bullet.Position
- TotalDistTraveled = TotalDistTraveled + DistTraveled
- end
- end
- end)
- end
- else
- if Bullet then Bullet:Destroy() end
- return HitPos
- end
- end
- function IsEnemy(Human)
- local Plyr = game.Players:GetPlayerFromCharacter(Human.Parent)
- if (not Plyr) then return S.CanDamageNPCs end
- return S.AllowFriendlyFire or (Plyr.TeamColor ~= Player.TeamColor or Plyr.Neutral)
- end
- --------------------[ RELOAD FUNCTIONS ]----------------------------------------------
- function ReloadAnim()
- TweenJoint(LWeld2, CF(), CF(), Sine, 0.15)
- TweenJoint(RWeld2, CF(), CF(), Sine, 0.15)
- local Speed = S.ReloadTime / 2
- local Mag_Parts = {}
- for _, Obj in pairs(Gun:GetChildren()) do
- if Obj.Name == "Mag" and Obj:IsA("BasePart") then
- INSERT(Mag_Parts, {Original = Obj, Clone1 = Obj:Clone(), Clone2 = Obj:Clone()})
- end
- end
- local W1 = nil
- local W2 = nil
- local SequenceTable = {
- function()
- for Index, Mag in pairs(Mag_Parts) do
- Mag.Original.Transparency = 1
- Mag.Clone1.Parent = Gun_Ignore
- Mag.Clone1.CanCollide = true
- if Index ~= 1 then
- local W = Instance.new("Weld")
- W.Part0 = Mag_Parts[1].Clone1
- W.Part1 = Mag.Clone1
- W.C0 = Mag_Parts[1].Clone1.CFrame:toObjectSpace(Mag.Clone1.CFrame)
- W.Parent = Mag_Parts[1].Clone1
- end
- end
- W1 = Instance.new("Weld")
- W1.Part0 = Mag_Parts[1].Clone1
- W1.Part1 = Handle
- W1.C0 = Mag_Parts[1].Original.CFrame:toObjectSpace(Handle.CFrame)
- W1.Parent = Mag_Parts[1].Clone1
- TweenJoint(LWeld, ArmC0[1], CF(0, 0.61, 0) * CFANG(RAD(70), 0, 0), Linear, 0.5 * Speed)
- TweenJoint(RWeld, ArmC0[2], CF(0.4, 0.09, -0.21) * CFANG(RAD(-20), RAD(3), 0), Linear, 0.5 * Speed)
- TweenJoint(Grip, Grip.C0, CFANG(0, RAD(10), 0), Linear, 0.5 * Speed)
- wait(0.5 * Speed)
- end;
- function()
- TweenJoint(RWeld, ArmC0[2], CF(0.4, -0.01, -0.31) * CFANG(RAD(-22), RAD(3), 0), Sine, 0.3 * Speed)
- wait(0.2 * Speed)
- end;
- function()
- W1:Destroy()
- Mag_Parts[1].Clone1.Velocity = Handle.Velocity + Handle.CFrame:vectorToWorldSpace(VEC3(0,-1,0)) * 20
- spawn(function()
- while Mag_Parts[1].Clone1.Velocity.magnitude > 0.1 do wait() end
- for _, Mag in pairs(Mag_Parts) do
- Mag.Clone1.Anchored = true
- Mag.Clone1:BreakJoints()
- end
- end)
- for Index, Mag in pairs(Mag_Parts) do
- Mag.Clone2.Parent = Gun_Ignore
- if Index ~= 1 then
- local W = Instance.new("Weld")
- W.Part0 = Mag_Parts[1].Clone2
- W.Part1 = Mag.Clone2
- W.C0 = Mag_Parts[1].Clone2.CFrame:toObjectSpace(Mag.Clone2.CFrame)
- W.Parent = Mag_Parts[1].Clone2
- end
- end
- W2 = Instance.new("Weld")
- W2.Part0 = FakeLArm
- W2.Part1 = Mag_Parts[1].Clone2
- W2.C0 = CF(0, -1, 0) * CFANG(RAD(-90), 0, 0)
- W2.Parent = FakeLArm
- wait(0.1)
- end;
- function()
- local FakeLArmCF = LWeld.Part0.CFrame * ArmC0[1] * (CF(0.3, 1.85, -0.31) * CFANG(RAD(-20), RAD(30), RAD(-60))):inverse()
- local FakeRArmCF = RWeld.Part0.CFrame * ArmC0[2] * (CF(0.4, -0.1, -0.21) * CFANG(RAD(-20), RAD(5), RAD(10))):inverse()
- local HandleCF = FakeRArm.CFrame:toObjectSpace(Grip.Part0.CFrame * Grip.C0)
- local Mag_Original_CF = Handle.CFrame:toObjectSpace(Mag_Parts[1].Original.CFrame)
- local MagC0 = FakeLArmCF:toObjectSpace(FakeRArmCF * HandleCF * Mag_Original_CF)
- TweenJoint(LWeld, ArmC0[1], CF(0.3, 1.85, -0.31) * CFANG(RAD(-20), RAD(30), RAD(-60)), Sine, 0.6 * Speed)
- TweenJoint(RWeld, ArmC0[2], CF(0.4, -0.1, -0.21) * CFANG(RAD(-20), RAD(5), RAD(10)), Sine, 0.6 * Speed)
- TweenJoint(Grip, Grip.C0, CF(), Sine, 0.6 * Speed)
- TweenJoint(W2, MagC0, CF(), Sine, 0.6 * Speed)
- wait(0.7 * Speed)
- end;
- function()
- for _, Mag in pairs(Mag_Parts) do
- Mag.Original.Transparency = 0
- Mag.Clone2:Destroy()
- end
- TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Sine, 0.5 * Speed)
- TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Sine, 0.5 * Speed)
- TweenJoint(Grip, Grip.C0, CFANG(0, RAD(20), 0), Sine, 0.5 * Speed)
- wait(0.5 * Speed)
- end;
- }
- for _,ReloadFunction in pairs(SequenceTable) do
- if BreakReload then
- break
- end
- ReloadFunction()
- end
- if W1 then W1:Destroy() end
- if W2 then W2:Destroy() end
- for _, Mag in pairs(Mag_Parts) do
- Mag.Clone1:Destroy()
- Mag.Clone2:Destroy()
- end
- end
- function Reload()
- Running = false
- if Ammo.Value < ClipSize.Value and (not Reloading) and StoredAmmo.Value > 0 then
- AmmoInClip = (AmmoInClip == 0 and Ammo.Value or AmmoInClip)
- Ammo.Value = 0
- Reloading = true
- if Aimed then UnAimGun(S.ReloadAnimation) end
- Gui_Clone.CrossHair.Reload.Visible = true
- if Handle:FindFirstChild("ReloadSound") then Handle.ReloadSound:Play() end
- if S.ReloadAnimation then
- wait()
- ReloadAnim()
- else
- local StartReload = tick()
- while true do
- if BreakReload then break end
- if (tick() - StartReload) >= S.ReloadTime then break end
- RS:wait()
- end
- end
- if (not BreakReload) then
- if StoredAmmo.Value >= ClipSize.Value then
- Ammo.Value = ClipSize.Value
- if AmmoInClip > 0 then
- StoredAmmo.Value = StoredAmmo.Value - (ClipSize.Value - AmmoInClip)
- else
- StoredAmmo.Value = StoredAmmo.Value - ClipSize.Value
- end
- elseif StoredAmmo.Value < ClipSize.Value and StoredAmmo.Value > 0 then
- Ammo.Value = StoredAmmo.Value
- StoredAmmo.Value = 0
- end
- end
- BreakReload = false
- Reloading = false
- if Selected then
- AmmoInClip = 0
- Gui_Clone.CrossHair.Reload.Visible = false
- end
- end
- end
- --------------------[ EXTERNAL DATA LOCATING FUNCTIONS ]-----------------------------
- function FindFirstClass(Object, Class)
- local FoundObject = nil
- for _, Obj in pairs(Object:GetChildren()) do
- if Obj.ClassName == Class then
- FoundObject = Obj
- break
- end
- end
- return FoundObject
- end
- function IsIgnored(Obj)
- for _,v in pairs(Ignore) do
- if Obj == v or Obj:IsDescendantOf(v) then
- return true
- end
- end
- return false
- end
- function GetHitSurfaceCFrame(HitPos,Obj)
- local SurfaceCF = {
- {"Back",Obj.CFrame * CF(0,0,Obj.Size.z)};
- {"Bottom",Obj.CFrame * CF(0,-Obj.Size.y,0)};
- {"Front",Obj.CFrame * CF(0,0,-Obj.Size.z)};
- {"Left",Obj.CFrame * CF(-Obj.Size.x,0,0)};
- {"Right",Obj.CFrame * CF(Obj.Size.x,0,0)};
- {"Top",Obj.CFrame * CF(0,Obj.Size.y,0)}
- }
- local ClosestDist = HUGE
- local ClosestSurface = nil
- for _,v in pairs(SurfaceCF) do
- local SurfaceDist = (HitPos - v[2].p).magnitude
- if SurfaceDist < ClosestDist then
- ClosestDist = SurfaceDist
- ClosestSurface = v
- end
- end
- return ClosestSurface[2]
- end
- function AdvRayCast(Origin, Direction, Dist, CustomIgnore)
- local NewIgnore = (CustomIgnore and CustomIgnore or Ignore)
- local NewRay = Ray.new(Origin, Direction * (Dist > 999 and 999 or Dist))
- local HitObj, HitPos = game.Workspace:FindPartOnRayWithIgnoreList(NewRay, NewIgnore)
- local LastPos = HitPos
- local FinalHitObj, FinalHitPos = nil, nil
- local RepTimes = math.floor(Dist / 999)
- if (not HitObj) and (Dist > 999) then
- for i = 0, RepTimes do
- local NewDist = (i == RepTimes and (Dist - (LastPos - Origin).magnitude) or 999)
- local Ray2 = Ray.new(LastPos, Direction * NewDist)
- local HitObj2, HitPos2 = game.Workspace:FindPartOnRayWithIgnoreList(Ray2, NewIgnore)
- if i ~= RepTimes then
- if HitObj2 then
- FinalHitObj, FinalHitPos = HitObj2, HitPos2
- break
- end
- elseif i == RepTimes then
- FinalHitObj, FinalHitPos = HitObj2, HitPos2
- end
- LastPos = HitPos2
- end
- return FinalHitObj, FinalHitPos
- elseif HitObj or (Dist <= 999) then
- return HitObj, HitPos
- end
- end
- --------------------[ KNIFING FUNCTION ]----------------------------------------------
- function KnifeAnim()
- local Connection = nil
- local Blade = Instance.new("Part")
- Blade.BrickColor = BrickColor.new("Really black")
- Blade.Name = "Blade"
- Blade.CanCollide = false
- Blade.FormFactor = Enum.FormFactor.Custom
- Blade.Size = VEC3(0.5, 2.5, 1)
- local Mesh = Instance.new("SpecialMesh")
- Mesh.MeshId = S.KnifeMeshId
- Mesh.MeshType = Enum.MeshType.FileMesh
- Mesh.Scale = VEC3(0.7, 0.7, 0.7)
- Mesh.TextureId = S.KnifeTextureId
- Mesh.Parent = Blade
- Blade.Parent = Gun_Ignore
- local BladeWeld = Instance.new("Weld")
- BladeWeld.Part0 = Blade
- BladeWeld.Part1 = FakeLArm
- BladeWeld.C0 = CFANG(RAD(-90), 0, RAD(180))
- BladeWeld.C1 = CF(0, -1, 0.75)
- BladeWeld.Parent = Blade
- Connection = Blade.Touched:connect(function(Obj)
- if Obj then
- local HitHumanoid = FindFirstClass(Obj.Parent, "Humanoid")
- if HitHumanoid and IsEnemy(HitHumanoid) then
- local CreatorTag = Instance.new("ObjectValue")
- CreatorTag.Name = "creator"
- CreatorTag.Value = Player
- CreatorTag.Parent = HitHumanoid
- HitHumanoid:TakeDamage(HitHumanoid.MaxHealth)
- MarkHit()
- end
- end
- end)
- TweenJoint(LWeld2, CF(), CFANG(0, RAD(90), 0), Linear, 0.05)
- TweenJoint(LWeld, ArmC0[1], CF(-0.1, 0.2, -0.1) * CFANG(0, 0, RAD(-20)), Linear, 0.05)
- TweenJoint(RWeld, ArmC0[2], CFANG(RAD(-30), 0, 0), Linear, 0.1)
- TweenJoint(Grip, Grip.C0, CF(), Linear, 0.1)
- spawn(function()
- local Force = HRP.CFrame.lookVector * 8e4
- local BF = Instance.new("BodyForce")
- BF.force = Force
- BF.Parent = HRP
- delay(0.03, function()
- BF.force = -Force / 2
- wait(0.03)
- BF:Destroy()
- end)
- end)
- wait(0.05)
- RotCamera(RAD(6), 0, true, 0.1)
- delay(0.1, function()
- RotCamera(RAD(-2), 0, true, 0.05)
- end)
- TweenJoint(LWeld, ArmC0[1], CF(0.8, 1.7, 0.2) * CFANG(0, 0, RAD(-80)), Linear, 0.06)
- wait(0.2)
- Connection:disconnect()
- wait(0.2)
- TweenJoint(LWeld2, CF(), CF(), Linear, 0.15)
- TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Linear, 0.15)
- TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Linear, 0.15)
- Blade:Destroy()
- end
- --------------------[ GRENADE FUNCTIONS ]---------------------------------------------
- function CreateGrenade()
- local Grenade = Instance.new("Model")
- local Center = Instance.new("Part")
- Center.BrickColor = S.GrenadeColor
- Center.Name = "Center"
- Center.CanCollide = false
- Center.Elasticity = 0
- Center.FormFactor = Enum.FormFactor.Custom
- Center.Size = S.GrenadeSize
- Center.BottomSurface = Enum.SurfaceType.Smooth
- Center.TopSurface = Enum.SurfaceType.Smooth
- Center.Parent = Grenade
- local Mesh1 = Instance.new("SpecialMesh")
- Mesh1.MeshType = Enum.MeshType.Sphere
- Mesh1.Parent = Center
- return Grenade
- end
- function CreateKnife()
- local Knife = Instance.new("Part")
- Knife.BrickColor = S.GrenadeColor
- Knife.Name = "Knife"
- Knife.CanCollide = false
- Knife.FormFactor = Enum.FormFactor.Custom
- Knife.Size = VEC3(1, 1, 3)
- local Mesh = Instance.new("SpecialMesh")
- Mesh.MeshId = "http://www.roblox.com/asset/?id=12221720"
- Mesh.MeshType = Enum.MeshType.FileMesh
- Mesh.Scale = VEC3(0.5, 0.5, 0.5)
- Mesh.Parent = Knife
- return Knife
- end
- function CreateTarget()
- local Target = Instance.new("Model")
- local Center = Instance.new("Part")
- Center.BrickColor = BrickColor.new("Bright red")
- Center.Material = Enum.Material.SmoothPlastic
- Center.Transparency = 0.3
- Center.Name = "Center"
- Center.Anchored = true
- Center.CanCollide = false
- Center.FormFactor = Enum.FormFactor.Custom
- Center.Size = VEC3(4, 0.2, 4)
- Center.Parent = Target
- local CylinderMesh = Instance.new("CylinderMesh")
- CylinderMesh.Parent = Center
- local Line = Instance.new("Part")
- Line.BrickColor = BrickColor.new("Bright red")
- Line.Transparency = 0.3
- Line.Name = "Line"
- Line.CFrame = Center.CFrame * CFrame.new(0, 5.1, 0)
- Line.Anchored = true
- Line.CanCollide = false
- Line.FormFactor = Enum.FormFactor.Custom
- Line.Size = VEC3(0.4, 10, 0.4)
- Line.BottomSurface = Enum.SurfaceType.Smooth
- Line.TopSurface = Enum.SurfaceType.Smooth
- Line.Parent = Target
- return Target
- end
- function DetonateExplosive(Grenade)
- CreateShockwave(Grenade.Position, S.GrenadeBlastRadius)
- local GrenadePos = Grenade.Position
- local E = Instance.new("Explosion")
- E.BlastPressure = S.GrenadeBlastPressure
- E.BlastRadius = S.GrenadeBlastRadius
- E.DestroyJointRadiusPercent = (S.GrenadeRangeBasedDamage and 0 or 1)
- E.ExplosionType = S.GrenadeExplosionType
- E.Position = GrenadePos
- E.Hit:connect(function(HObj, HDist)
- if HObj.Name == "Torso" and (not HObj:IsDescendantOf(Character)) then
- if S.GrenadeRangeBasedDamage then
- local ClosestPart = nil
- local ClosestDist = math.huge
- for _, P in pairs(HObj.Parent:GetChildren()) do
- if P:IsA("BasePart") then
- local Dist = (GrenadePos - P.Position).magnitude
- if Dist < ClosestDist then
- ClosestPart = P
- ClosestDist = Dist
- end
- end
- end
- local Dir = (ClosestPart.Position - GrenadePos).unit
- local H, P = AdvRayCast(GrenadePos, Dir, 999)
- local RayHitHuman = H:IsDescendantOf(HObj.Parent)
- if (S.GrenadeRayCastExplosions and RayHitHuman) or (not S.GrenadeRayCastExplosions) then
- local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
- if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
- local DistFactor = ClosestDist / S.GrenadeBlastRadius
- local DistInvert = math.max(1 - DistFactor,0)
- local NewDamage = DistInvert * S.LethalGrenadeDamage
- local CreatorTag = Instance.new("ObjectValue")
- CreatorTag.Value = Player
- CreatorTag.Name = "creator"
- CreatorTag.Parent = HitHumanoid
- HitHumanoid:TakeDamage(NewDamage)
- MarkHit()
- end
- end
- else
- local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
- if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
- local CreatorTag = Instance.new("ObjectValue")
- CreatorTag.Value = Player
- CreatorTag.Name = "creator"
- CreatorTag.Parent = HitHumanoid
- MarkHit()
- end
- end
- end
- end)
- E.Parent = game.Workspace
- wait()
- Grenade.Parent:Destroy()
- end
- function DetonateSmoke(Grenade)
- CreateShockwave(Grenade.Position, S.GrenadeEffectRadius)
- local GrenadePos = Grenade.Position
- spawn(function()
- for i = 1, math.floor(S.GrenadeEffectRadius / 5) + RAND(5, 10) do
- local Size = RAND(S.GrenadeEffectRadius * 0.6, S.GrenadeEffectRadius * 0.8)
- local Dist = RAND(0, S.GrenadeEffectRadius - Size)
- local XRot, YRot = RAD(RAND(0, 180, 10)), RAD(RAND(0, 360, 10))
- local RotLV = (CFANG(0, YRot, 0) * CFANG(XRot, 0, 0)).lookVector
- local Pos = GrenadePos + (RotLV * VEC3(Dist, Dist / 2, Dist))
- local Smoke = Instance.new("Part")
- Smoke.Transparency = 1
- Smoke.Name = "Smoke"
- Smoke.Anchored = true
- Smoke.CanCollide = false
- Smoke.FormFactor = Enum.FormFactor.Symmetric
- Smoke.Size = VEC3(1, 1, 1)
- Smoke.TopSurface = Enum.SurfaceType.Smooth
- Smoke.BottomSurface = Enum.SurfaceType.Smooth
- local Mesh = Instance.new("SpecialMesh")
- Mesh.MeshType = Enum.MeshType.Sphere
- Mesh.Scale = VEC3(Size, Size, Size)
- Mesh.Parent = Smoke
- Smoke.Parent = Gun_Ignore
- Smoke.CFrame = CF(Pos)
- spawn(function()
- local Trans = RAND(0.3, 0.5, 0.01)
- for X = 0, 90, 2 do
- Smoke.CFrame = CF(GrenadePos:lerp(Pos, Sine(X)))
- Smoke.Transparency = NumLerp(1, Trans, Sine(X))
- RS:wait()
- end
- wait(S.GrenadeEffectTime)
- for X = 0, 90, 0.5 do
- Smoke.CFrame = CF(Pos:lerp(Pos + VEC3(0, 20, 0), 1 - COS(RAD(X))))
- Smoke.Transparency = NumLerp(Trans, 1, Sine(X))
- RS:wait()
- end
- Smoke:Destroy()
- end)
- if i % 3 == 0 then
- RS:wait()
- end
- end
- end)
- wait()
- Grenade.Parent:Destroy()
- end
- function ThrowGrenade(Type)
- local Grenade0 = nil
- if S.TrajectoryAssist then
- spawn(function()
- local X = 0
- local Vel = (Type == 1 and S.LethalGrenadeThrowVelocity or S.TacticalGrenadeThrowVelocity)
- local GetX = function(Ang, T)
- local Vx = Vel * math.cos(Ang)
- return Vx * T
- end
- local GetY = function(Ang, T)
- local V0y = Vel * math.sin(Ang)
- local Vy = V0y + (-196.2 * T)
- return (Vy * T) - (-98.1 * T * T)
- end
- local Target = CreateTarget()
- Target.Parent = game.Workspace
- Target.PrimaryPart = Target:WaitForChild("Center")
- while (Keys[S.LethalGrenadeKey] or Keys[S.TacticalGrenadeKey]) and Selected do
- X = X + math.rad(10)
- for _,v in pairs(Target:GetChildren()) do
- v.Transparency = 0.2 + ((math.sin(X) + 1) / 5)
- end
- local Lines = {}
- local LastX, LastY = nil, nil
- for T = 0, 10, 0.1 do
- local XPos = GetX(math.rad(7) - HeadRot, T)
- local YPos = GetY(math.rad(7) - HeadRot, T)
- if LastX and LastY then
- local LookV3 = HRP.CFrame.lookVector
- local LastPos = (Head.CFrame * CF(1.5, 0, 0)).p + (LookV3 * LastX) + VEC3(0, LastY, 0)
- local NewPos = (Head.CFrame * CF(1.5, 0, 0)).p + (LookV3 * XPos) + VEC3(0, YPos, 0)
- local LineCF = CF(LastPos, NewPos)
- local Dist = (LastPos - NewPos).magnitude
- local NewDist = Dist
- local H, P = AdvRayCast(LastPos, (NewPos - LastPos), 1, {Camera, unpack(Ignore)})
- if H then
- NewDist = (P - LastPos).magnitude
- local SurfaceCF = GetHitSurfaceCFrame(P, H)
- local SurfaceDir = CF(H.CFrame.p, SurfaceCF.p)
- local SurfaceDist = SurfaceDir.lookVector * (H.CFrame.p - SurfaceCF.p).magnitude / 2
- local SurfaceOffset = P - SurfaceCF.p + SurfaceDist
- local SurfaceCFrame = SurfaceDir + SurfaceDist + SurfaceOffset
- Target:SetPrimaryPartCFrame(SurfaceCFrame * CFANG(RAD(-90), 0, 0))
- Target.Parent = Camera
- else
- Target.Parent = nil
- end
- local Line = Instance.new("Part")
- Line.BrickColor = BrickColor.Red()
- Line.Material = Enum.Material.SmoothPlastic
- Line.Transparency = 0.2 + ((math.sin(X) + 1) / 5)
- Line.Anchored = true
- Line.CanCollide = false
- Line.FormFactor = Enum.FormFactor.Custom
- Line.Size = Vector3.new(0.4, 0.4, NewDist)
- Line.TopSurface = Enum.SurfaceType.Smooth
- Line.BottomSurface = Enum.SurfaceType.Smooth
- Line.CFrame = LineCF + (LineCF.lookVector * NewDist / 2)
- Line.Parent = Camera
- table.insert(Lines, Line)
- LastX,LastY = XPos,YPos
- if H then break end
- else
- LastX,LastY = XPos,YPos
- end
- end
- wait()
- for _,Line in pairs(Lines) do
- Line:Destroy()
- end
- end
- Target:Destroy()
- end)
- end
- local AnimTable = {
- function()
- TweenJoint(LWeld, CF(-1.5, 0, 0), CF(0, 0.6, 0), Linear, 0.2)
- TweenJoint(RWeld, CF(1.5, 0, 0) * CFANG(0, 0, RAD(-10)), CF(0, 0.6, 0), Linear, 0.2)
- TweenJoint(Grip, Grip.C0, CFANG(0, RAD(10), 0), Linear, 0.2)
- wait(0.3)
- end;
- function()
- Grip.Part0 = Torso
- Grip.C1 = CF(-1, 0.5, -0.5)
- if S.LethalGrenadeType == 3 and Type == 1 then
- Grenade0 = CreateKnife()
- Grenade0.Parent = Gun_Ignore
- local Weld = Instance.new("Weld")
- Weld.Part0 = FakeRArm
- Weld.Part1 = Grenade0
- Weld.C0 = Grip.C0
- Weld.C1 = CF(0, 0, -0.5) * CFANG(RAD(90), RAD(90), 0)
- Weld.Parent = Grenade0
- TweenJoint(LWeld2, CF(), CF(), Sine, 0.3)
- TweenJoint(RWeld2, CF(), CF(), Sine, 0.3)
- TweenJoint(LWeld, ArmC0[1], CF(0, 0.5, 0.1) * CFANG(RAD(90), 0, 0), Sine, 0.3)
- TweenJoint(RWeld, ArmC0[2], CF(0, 0.4, 0.1) * CFANG(RAD(-80), 0, 0), Sine, 0.3)
- wait(0.3)
- else
- Grenade0 = CreateGrenade()
- Grenade0.Parent = Gun_Ignore
- local Weld = Instance.new("Weld")
- Weld.Part0 = FakeRArm
- Weld.Part1 = Grenade0:WaitForChild("Center")
- Weld.C0 = Grip.C0
- Weld.Parent = Grenade0:WaitForChild("Center")
- TweenJoint(LWeld2, CF(), CFANG(0, RAD(80), 0), Linear, 0.25)
- TweenJoint(RWeld2, CF(), CFANG(0, RAD(-80), 0), Linear, 0.25)
- TweenJoint(LWeld, ArmC0[1], CF(-0.2, 0.8, 0.1) * CFANG(RAD(10), 0, RAD(-30)), Linear, 0.25)
- TweenJoint(RWeld, ArmC0[2], CF(0.2, 0.8, 0.1) * CFANG(RAD(10), 0, RAD(30)), Linear, 0.25)
- wait(0.3)
- end
- end;
- function()
- repeat wait() until (not Keys[S.LethalGrenadeKey]) and (not Keys[S.TacticalGrenadeKey]) or (not Selected)
- end;
- function()
- if S.LethalGrenadeType ~= 3 or Type == 2 then
- TweenJoint(LWeld2, CF(), CFANG(0, RAD(45), 0), Sine, 0.2)
- TweenJoint(RWeld2, CF(), CFANG(0, RAD(-45), 0), Sine, 0.2)
- TweenJoint(LWeld, ArmC0[1], CF(0, 0.8, 0.1), Sine, 0.2)
- TweenJoint(RWeld, ArmC0[2], CF(0, 0.8, 0.1), Sine, 0.2)
- wait(0.2)
- end
- end;
- function()
- if S.LethalGrenadeType ~= 3 or Type == 2 then
- TweenJoint(LWeld2, CF(), CF(), Sine, 0.3)
- TweenJoint(RWeld2, CF(), CF(), Sine, 0.3)
- TweenJoint(LWeld, ArmC0[1], CF(0, 0.5, 0.1) * CFANG(RAD(90), 0, 0), Sine, 0.3)
- TweenJoint(RWeld, ArmC0[2], CF(0, 0.4, 0.1) * CFANG(RAD(-80), 0, 0), Sine, 0.3)
- wait(0.3)
- end
- end;
- function()
- TweenJoint(RWeld, ArmC0[2], CF(0, 0.8, 0.1) * CFANG(RAD(-10), 0, 0), Sine, 0.1)
- wait(0.07)
- end;
- function()
- local Main = nil
- Grenade0:Destroy()
- if S.LethalGrenadeType == 3 and Type == 1 then
- local Grenade1 = CreateKnife()
- Main = Grenade1
- Grenade1.Parent = Gun_Ignore
- Main.CFrame = FakeRArm.CFrame * Grip.C0 * CF(0, 0.5, 0) * CFANG(RAD(-90), 0, RAD(90))
- Main.Velocity = Main.Velocity + ((Head.CFrame * CFANG(RAD(7), 0, 0)).lookVector * S.LethalGrenadeThrowVelocity)
- Main.RotVelocity = (Main.CFrame * CFANG(RAD(90), 0, 0)).lookVector * 20
- else
- local Grenade1 = CreateGrenade()
- Main = Grenade1:WaitForChild("Center")
- local Sound = Instance.new("Sound")
- Sound.SoundId = (Type == 1 and "rbxassetid://180302005" or "rbxassetid://156283116")
- Sound.Volume = 1
- Sound.PlayOnRemove = true
- Sound.Parent = Main
- Grenade1.Parent = Gun_Ignore
- Main.CanCollide = true
- Main.CFrame = FakeRArm.CFrame * Grip.C0
- if Type == 1 then
- Main.Velocity = Main.Velocity + ((Head.CFrame * CFANG(RAD(7), 0, 0)).lookVector * S.LethalGrenadeThrowVelocity)
- elseif Type == 2 then
- Main.Velocity = Main.Velocity + ((Head.CFrame * CFANG(RAD(7), 0, 0)).lookVector * S.TacticalGrenadeThrowVelocity)
- end
- end
- spawn(function()
- if Type == 1 then
- if S.LethalGrenadeType == 1 then
- if S.TimerStartOnHit then
- local Detonated = false
- Main.Touched:connect(function(Obj)
- if IsIgnored(Obj) or Detonated then return end
- Main.Velocity = Main.Velocity / 4
- Detonated = true
- wait(S.DetonationTime)
- DetonateExplosive(Main)
- end)
- else
- spawn(function()
- local Touched = false
- Main.Touched:connect(function(Obj)
- if IsIgnored(Obj) or Touched then return end
- Touched = true
- Main.Velocity = Main.Velocity / 4
- end)
- end)
- wait(S.DetonationTime)
- DetonateExplosive(Main)
- end
- elseif S.LethalGrenadeType == 2 then
- local Detonated = false
- local GrenadeCF = nil
- Main.Touched:connect(function(Obj)
- if IsIgnored(Obj) or Detonated then return end
- GrenadeCF = Main.CFrame
- local W = Instance.new("Weld")
- W.Name = "Semtex"
- W.Part0 = Main
- W.Part1 = Obj
- W.C0 = GrenadeCF:toObjectSpace(Obj.CFrame)
- W.Parent = Main
- Main.ChildRemoved:connect(function(C)
- if C.Name == "Semtex" then
- local W = Instance.new("Weld")
- W.Name = "Semtex"
- W.Part0 = Main
- W.Part1 = Obj
- W.C0 = GrenadeCF:toObjectSpace(Obj.CFrame)
- W.Parent = Main
- end
- end)
- if S.TimerStartOnHit then
- Detonated = true
- wait(S.DetonationTime)
- DetonateExplosive(Main)
- end
- end)
- if (not S.TimerStartOnHit) then
- wait(S.DetonationTime)
- Detonated = true
- DetonateExplosive(Main)
- end
- elseif S.LethalGrenadeType == 3 then
- local Touched = false
- Main.Touched:connect(function(Obj)
- if IsIgnored(Obj) or Touched then return end
- Touched = true
- local W = Instance.new("Weld")
- W.Name = "Sticky"
- W.Part0 = Main
- W.Part1 = Obj
- W.C0 = Main.CFrame:toObjectSpace(Obj.CFrame)
- W.Parent = Main
- Main.ChildRemoved:connect(function(C)
- if C.Name == "Sticky" then
- local W = Instance.new("Weld")
- W.Name = "Sticky"
- W.Part0 = Main
- W.Part1 = Obj
- W.C0 = Main.CFrame:toObjectSpace(Obj.CFrame)
- W.Parent = Main
- end
- end)
- if Obj then
- if Obj.Parent.ClassName == "Hat" then
- local HitHumanoid = FindFirstClass(Obj.Parent.Parent, "Humanoid")
- if HitHumanoid and IsEnemy(HitHumanoid) then
- local CreatorTag = Instance.new("ObjectValue")
- CreatorTag.Name = "creator"
- CreatorTag.Value = Player
- CreatorTag.Parent = HitHumanoid
- HitHumanoid:TakeDamage(HitHumanoid.MaxHealth)
- MarkHit()
- end
- else
- local HitHumanoid = FindFirstClass(Obj.Parent, "Humanoid")
- if HitHumanoid and IsEnemy(HitHumanoid) then
- local CreatorTag = Instance.new("ObjectValue")
- CreatorTag.Name = "creator"
- CreatorTag.Value = Player
- CreatorTag.Parent = HitHumanoid
- HitHumanoid:TakeDamage(HitHumanoid.MaxHealth)
- MarkHit()
- end
- end
- end
- wait(3)
- Main:Destroy()
- end)
- end
- elseif Type == 2 then
- if S.TacticalGrenadeType == 1 then
- if S.TimerStartOnHit then
- local Detonated = false
- Main.Touched:connect(function(Obj)
- if IsIgnored(Obj) or Detonated then return end
- Main.Velocity = Main.Velocity / 2
- Detonated = true
- wait(S.DetonationTime)
- DetonateSmoke(Main)
- end)
- else
- spawn(function()
- local Touched = false
- Main.Touched:connect(function(Obj)
- if IsIgnored(Obj) or Touched then return end
- Touched = true
- Main.Velocity = Main.Velocity / 2
- end)
- end)
- wait(S.DetonationTime)
- DetonateSmoke(Main)
- end
- end
- end
- end)
- if S.GrenadeTrail and S.GrenadeTrailTransparency ~= 1 then
- spawn(function()
- local LastPos = nil
- while true do
- if LastPos then
- if (not Main:IsDescendantOf(game))
- or (Main.Name == "Knife" and FindFirstClass(Main, "Weld")) then
- break
- end
- local Trail = Instance.new("Part")
- Trail.BrickColor = S.GrenadeTrailColor
- Trail.Transparency = S.GrenadeTrailTransparency
- Trail.Anchored = true
- Trail.CanCollide = false
- Trail.Size = VEC3(1, 1, 1)
- local Mesh = Instance.new("BlockMesh")
- Mesh.Offset = VEC3(0, 0, -(Main.Position - LastPos).magnitude / 2)
- Mesh.Scale = VEC3(S.GrenadeTrailThickness, S.GrenadeTrailThickness, (Main.Position - LastPos).magnitude)
- Mesh.Parent = Trail
- Trail.Parent = Gun_Ignore
- Trail.CFrame = CF(LastPos, Main.Position)
- delay(S.GrenadeTrailVisibleTime, function()
- if S.GrenadeTrailDisappearTime > 0 then
- local X = 0
- while true do
- if X == 90 then break end
- if (not Selected) then break end
- local NewX = X + (1.5 / S.GrenadeTrailDisappearTime)
- X = (NewX > 90 and 90 or NewX)
- local Alpha = X / 90
- Trail.Transparency = NumLerp(S.GrenadeTrailTransparency, 1, Alpha)
- RS:wait()
- end
- Trail:Destroy()
- else
- Trail:Destroy()
- end
- end)
- LastPos = Main.Position
- else
- LastPos = Main.Position
- end
- RS:wait()
- end
- end)
- end
- wait(0.2)
- end;
- function()
- TweenJoint(RWeld, CF(1.5, 0, 0) * CFANG(0, 0, RAD(-10)), CF(0, 0.6, 0), Linear, 0.2)
- wait(0.3)
- end;
- function()
- Grip.Part0 = RArm
- Grip.C1 = CFANG(0, RAD(20), 0)
- TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Linear, 0.2)
- TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Linear, 0.2)
- wait(0.2)
- end;
- }
- for _,F in pairs(AnimTable) do
- if (not Selected) then
- break
- end
- F()
- end
- if (not Selected) and Grenade0 then
- Grenade0:Destroy()
- end
- end
- --------------------[ CAMERA STEADYING FUNCTIONS ]------------------------------------
- function SteadyCamera()
- Gui_Clone.Scope.Steady.Text = "Steadying..."
- Gui_Clone.Scope.Steady.TextColor3 = Color3.new(1, 1, 0)
- CameraSteady = true
- local OriginalSway = CameraSway
- for X = 0, 90, 1.5 / 0.6 do
- if (not Run_Key_Pressed) then break end
- local Alpha = SIN(RAD(X))
- CameraSway = NumLerp(OriginalSway, 0, Alpha)
- RS:wait()
- end
- while Run_Key_Pressed and Aimed do
- if CurrentSteadyTime > 0 then
- local NewSteadyTime = CurrentSteadyTime - 1
- CurrentSteadyTime = (NewSteadyTime < 0 and 0 or NewSteadyTime)
- CameraSway = 0
- elseif CurrentSteadyTime == 0 then
- break
- end
- RS:wait()
- end
- CameraSteady = false
- spawn(function()
- for X = 0, 90, 1.5 / 0.2 do
- local Alpha = math.log10(X) / math.log10(90)
- CameraSway = NumLerp(0, 3, Alpha)
- RS:wait()
- end
- for X = 0, 90, 1.5 / S.ScopeSteadyTime do
- if CameraSteady then break end
- local Alpha = SIN(RAD(X))
- CameraSway = NumLerp(3, 1, Alpha)
- RS:wait()
- end
- end)
- RetakeBreath()
- end
- function RetakeBreath()
- local Steady = Gui_Clone.Scope.Steady
- Steady.Text = "Re-taking Breath"
- Steady.TextColor3 = Color3.new(1, 0, 0)
- TakingBreath = true
- while TakingBreath do
- if CurrentSteadyTime < MaxSteadyTime then
- local NewSteadyTime = CurrentSteadyTime + (S.ScopeSteadyTime / S.SteadyCooldownTime)
- CurrentSteadyTime = (NewSteadyTime > MaxSteadyTime and MaxSteadyTime or NewSteadyTime)
- elseif CurrentSteadyTime >= MaxSteadyTime then
- break
- end
- RS:wait()
- end
- if TakingBreath then
- Steady.Text = "Hold "..ConvertKey(S.ScopeSteadyKey).." to Steady"
- Steady.TextColor3 = Color3.new(1, 1, 0)
- TakingBreath = false
- end
- end
- --------------------[ SPRINTING FUNCTIONS ]-------------------------------------------
- function MonitorStamina()
- while Run_Key_Pressed do
- if (not Aimed) and (not Aiming) then
- break
- end
- RS:wait()
- end
- while Run_Key_Pressed and (not Aiming) and (not Aimed) and (not Knifing) and (not ThrowingGrenade) do
- local Forward = (Keys["w"] or Keys[string.char(17)])
- local Backward = (Keys["s"] or Keys[string.char(18)])
- if (Forward and (not Backward))
- and Walking and (Stamina > 0) then
- if Stance == 1 or Stance == 2 then Stand() end
- local NewStamina = Stamina - 1
- Stamina = (NewStamina < 0 and 0 or NewStamina)
- Running = true
- elseif (not (Forward and (not Backward)))
- or (not Walking) or (Stamina == 0) then
- break
- end
- RS:wait()
- end
- Running = false
- RechargeStamina()
- end
- function RechargeStamina()
- ChargingStamina = true
- while ((not Run_Key_Pressed) or (Stamina < MaxStamina)) and (not Running) do
- if Stamina < MaxStamina then
- local NewStamina = Stamina + (S.SprintTime / S.StaminaCoolTime)
- Stamina = (NewStamina > MaxStamina and MaxStamina or NewStamina)
- elseif Stamina >= MaxStamina then
- break
- end
- RS:wait()
- end
- ChargingStamina = false
- end
- --------------------[ STANCE FUNCTIONS ]----------------------------------------------
- function Stand(OnDeselected)
- local LHip = Torso["Left Hip"]
- local RHip = Torso["Right Hip"]
- local Root = HRP.RootJoint
- Stance = 0
- if S.StanceAnimation and (not OnDeselected) then
- spawn(function()
- local PreviousOffset = Humanoid.CameraOffset
- local PreviousRootP = Root.C0.p
- for X = 0, 90, 1.5 / S.StanceChangeSpeed do
- if Stance ~= 0 then break end
- local Alpha = Sine(X)
- Humanoid.CameraOffset = PreviousOffset:lerp(StanceOffset[1], Alpha)
- Root.C0 = CF(PreviousRootP:lerp(VEC3(), Alpha)) * CFANG(RAD(-90), 0, RAD(180))
- RS:wait()
- end
- end)
- TweenJoint(ABWeld, CF(), CF(), Sine, S.StanceChangeSpeed)
- TweenJoint(LHip, CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0), Sine, S.StanceChangeSpeed)
- TweenJoint(RHip, CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0), Sine, S.StanceChangeSpeed)
- elseif OnDeselected then
- Humanoid.CameraOffset = StanceOffset[1]
- ABWeld.C0 = CF()
- ABWeld.C1 = CF()
- LHip.C0 = CF(-1, -1, 0) * CFANG(0, RAD(-90), 0)
- LHip.C1 = CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0)
- RHip.C0 = CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0)
- RHip.C1 = CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0)
- Root.C0 = CFANG(RAD(-90), 0, RAD(180))
- end
- end
- function Crouch()
- local LHip = Torso["Left Hip"]
- local RHip = Torso["Right Hip"]
- local Root = HRP.RootJoint
- Stance = 1
- if S.StanceAnimation then
- spawn(function()
- local PreviousOffset = Humanoid.CameraOffset
- local PreviousRootP = Root.C0.p
- for X = 0, 90, 1.5 / S.StanceChangeSpeed do
- if Stance ~= 1 then break end
- local Alpha = Sine(X)
- Humanoid.CameraOffset = PreviousOffset:lerp(StanceOffset[2], Alpha)
- Root.C0 = CF(PreviousRootP:lerp(VEC3(0, -1, 0), Alpha)) * CFANG(RAD(-90), 0, RAD(180))
- RS:wait()
- end
- end)
- TweenJoint(ABWeld, CF(0, 0, -1 / 16), CF(), Sine, S.StanceChangeSpeed)
- TweenJoint(LHip, CF(-1, -0.5, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 0.5, 1) * CFANG(0, RAD(-90), RAD(-90)), Sine, S.StanceChangeSpeed)
- TweenJoint(RHip, CF(1, -0.5, 0.25) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 0.5, 1) * CFANG(RAD(-180), RAD(90), 0), Sine, S.StanceChangeSpeed)
- else
- Humanoid.CameraOffset = StanceOffset[2]
- ABWeld.C0 = CF(0, 0, -1 / 16)
- ABWeld.C1 = CF()
- LHip.C0 = CF(-1, -0.5, 0) * CFANG(0, RAD(-90), 0)
- LHip.C1 = CF(-0.5, 0.5, 1) * CFANG(0, RAD(-90), RAD(-90))
- RHip.C0 = CF(1, -0.5, 0.25) * CFANG(RAD(-180), RAD(90), 0)
- RHip.C1 = CF(0.5, 0.5, 1) * CFANG(RAD(-180), RAD(90), 0)
- Root.C0 = CF(0, -1, 0) * CFANG(RAD(-90), 0, RAD(180))
- end
- end
- function Prone()
- local LHip = Torso["Left Hip"]
- local RHip = Torso["Right Hip"]
- local Root = HRP.RootJoint
- Stance = 2
- if S.StanceAnimation then
- spawn(function()
- local PreviousOffset = Humanoid.CameraOffset
- local PreviousRootP = Root.C0.p
- for X = 0, 90, 1.5 / S.StanceChangeSpeed do
- if Stance ~= 2 then break end
- local Alpha = Sine(X)
- Humanoid.CameraOffset = PreviousOffset:lerp(StanceOffset[3], Alpha)
- Root.C0 = CF(PreviousRootP:lerp(VEC3(0, -2.5, 1), Alpha)) * CFANG(RAD(180), 0, RAD(180))
- RS:wait()
- end
- end)
- TweenJoint(ABWeld, CF(0, 0, -1 / 8), CF(), Sine, S.StanceChangeSpeed)
- TweenJoint(LHip, CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0), Sine, S.StanceChangeSpeed)
- TweenJoint(RHip, CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0), Sine, S.StanceChangeSpeed)
- else
- Humanoid.CameraOffset = StanceOffset[3]
- ABWeld.C0 = CF(0, 0, -1 / 8)
- ABWeld.C1 = CF()
- LHip.C0 = CF(-1, -1, 0) * CFANG(0, RAD(-90), 0)
- LHip.C1 = CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0)
- RHip.C0 = CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0)
- RHip.C1 = CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0)
- Root.C0 = CF(0, -2.5, 1) * CFANG(RAD(180), 0, RAD(180))
- end
- end
- function Dive(Speed)
- local DiveVelocity = (HRP.CFrame * CFANG(RAD(18),0,0)).lookVector * Speed * (35 / 16) * 4e3
- HRP.Velocity = VEC3()
- Torso.Velocity = VEC3()
- local BF = Instance.new("BodyForce")
- BF.force = DiveVelocity
- BF.Parent = HRP
- delay(0.05, function()
- Prone()
- local Start = tick()
- while true do
- wait()
- if (tick() - Start) > 0.1 then break end
- BF.force = -HRP.Velocity * 700
- end
- BF:Destroy()
- end)
- end
- --------------------[ KEYBOARD FUNCTIONS ]--------------------------------------------
- function KeyDown(K)
- local Key = string.lower(K)
- if Key == S.LowerStanceKey and S.CanChangeStance then
- if (not Running) then
- if Stance == 0 then
- Crouch()
- elseif Stance == 1 then
- Prone()
- end
- elseif S.DolphinDive then
- delay(1 / 30,function()
- CanRun = false
- Dive(S.BaseWalkSpeed)
- Run_Key_Pressed = false
- wait(S.DiveRechargeTime)
- CanRun = true
- end)
- end
- end
- if Key == S.RaiseStanceKey and S.CanChangeStance then
- if (not Running) then
- if Stance == 2 then
- Crouch()
- elseif Stance == 1 then
- Stand()
- end
- end
- end
- if Key == S.ADSKey then
- if S.HoldMouseOrKeyToADS then
- if (not AimingIn) and (not Aimed) then
- AimingIn = true
- AimGun()
- AimingIn = false
- end
- else
- if Aimed then
- UnAimGun()
- else
- AimGun()
- end
- end
- end
- if Key == S.ReloadKey then
- if (not Reloading) and (not Running) then
- Reload()
- end
- end
- if Key == S.KnifeKey and S.CanKnife then
- if KnifeReady and (not Knifing) and (not ThrowingGrenade) then
- if Aimed then UnAimGun(true) end
- BreakReload = true
- Knifing = true
- KnifeReady = false
- KnifeAnim()
- BreakReload = false
- Knifing = false
- delay(S.KnifeCooldown, function()
- KnifeReady = true
- end)
- end
- end
- if Key == S.LethalGrenadeKey and S.Throwables then
- if (not Knifing) and (not Running) and (not Aimed) and (not Aiming) and (not ThrowingGrenade) then
- if LethalGrenades.Value > 0 then
- LethalGrenades.Value = LethalGrenades.Value - 1
- ThrowingGrenade = true
- ThrowGrenade(1)
- ThrowingGrenade = false
- end
- end
- end
- if Key == S.TacticalGrenadeKey and S.Throwables then
- if (not Knifing) and (not Running) and (not Aimed) and (not Aiming) and (not ThrowingGrenade) then
- if TacticalGrenades.Value > 0 then
- TacticalGrenades.Value = TacticalGrenades.Value - 1
- ThrowingGrenade = true
- ThrowGrenade(2)
- ThrowingGrenade = false
- end
- end
- end
- if Key == S.SprintKey then
- Run_Key_Pressed = true
- if Aimed and (not Aiming) then
- TakingBreath = false
- SteadyCamera()
- end
- if CanRun then
- if (not Idleing) and Walking and (not Running) and (not Knifing) and (not ThrowingGrenade) then
- if Reloading then BreakReload = true end
- MonitorStamina()
- end
- end
- end
- end
- function KeyUp(K)
- local Key = string.lower(K)
- if Key == S.ADSKey then
- if S.HoldMouseOrKeyToADS then
- if (not AimingOut) and Aimed then
- AimingOut = true
- UnAimGun()
- AimingOut = false
- end
- end
- end
- if Key == S.SprintKey then
- Run_Key_Pressed = false
- Running = false
- if (not ChargingStamina) then
- RechargeStamina()
- end
- end
- end
- --------------------[ END FUNCTIONS ]-------------------------------------------------
- --------------------------------------------------------------------------------------
- --------------------[ TOOL SELECTION AND DESELECTION ]--------------------------------
- --------------------------------------------------------------------------------------
- function OnEquipped(M_Icon)
- wait(math.random(10, 40) / 100)
- if Humanoid.Health ~= 0 and (not Selected) and Gun.Parent == Character then
- Selected = true
- BreakReload = false
- --------------------[ FAILSAFE RESETING ]-------------------------------------
- for _, GM in pairs(Ignore_Model:GetChildren()) do
- if GM.Name == "Gun_Ignore_"..Player.Name then
- GM:Destroy()
- end
- end
- for _,c in pairs(Connections) do
- c:disconnect()
- end
- Connections = {}
- --------------------[ CREATING IGNORE MODELS ]--------------------------------
- Gun_Ignore = Instance.new("Model")
- Gun_Ignore.Name = "Gun_Ignore_"..Player.Name
- Gun_Ignore.Parent = Ignore_Model
- --------------------[ MODIFYING THE PLAYER ]----------------------------------
- M_Icon.Icon = "rbxasset://textures\\Blank.png"
- Gui_Clone = Main_Gui:Clone()
- Gui_Clone.Parent = Player.PlayerGui
- SetUpGui()
- Shoulders.Right.Part1 = nil
- Shoulders.Left.Part1 = nil
- PrevNeckCF.C0 = Neck.C0
- PrevNeckCF.C1 = Neck.C1
- BG = Instance.new("BodyGyro", HRP)
- BG.maxTorque = VEC3(HUGE, HUGE, HUGE)
- BG.Name = "BG"
- BG.P = 1e5
- BG.cframe = CF(Torso.CFrame.p, Torso.CFrame.p + Torso.CFrame.lookVector)
- local PlayerFolder = Instance.new("Model")
- PlayerFolder.Name = "PlayerFolder"
- PlayerFolder.Parent = Gun_Ignore
- local AnimBase = Instance.new("Part")
- AnimBase.Transparency = 1
- AnimBase.Name = "AnimBase"
- AnimBase.CanCollide = false
- AnimBase.FormFactor = Enum.FormFactor.Custom
- AnimBase.Size = VEC3(0.2, 0.2, 0.2)
- AnimBase.BottomSurface = Enum.SurfaceType.Smooth
- AnimBase.TopSurface = Enum.SurfaceType.Smooth
- AnimBase.Parent = PlayerFolder
- AnimWeld = Instance.new("Weld")
- AnimWeld.Part0 = AnimBase
- AnimWeld.Part1 = Head
- AnimWeld.C0 = CF(0, 1, 0)
- AnimWeld.Parent = AnimBase
- local ArmBase = Instance.new("Part")
- ArmBase.Transparency = 1
- ArmBase.Name = "ArmBase"
- ArmBase.CanCollide = false
- ArmBase.FormFactor = Enum.FormFactor.Custom
- ArmBase.Size = VEC3(0.2, 0.2, 0.2)
- ArmBase.BottomSurface = Enum.SurfaceType.Smooth
- ArmBase.TopSurface = Enum.SurfaceType.Smooth
- ArmBase.Parent = PlayerFolder
- ABWeld = Instance.new("Weld")
- ABWeld.Part0 = ArmBase
- ABWeld.Part1 = AnimBase
- ABWeld.Parent = ArmBase
- local LArmBase = Instance.new("Part")
- LArmBase.Transparency = 1
- LArmBase.Name = "LArmBase"
- LArmBase.CanCollide = false
- LArmBase.FormFactor = Enum.FormFactor.Custom
- LArmBase.Size = VEC3(0.2, 0.2, 0.2)
- LArmBase.BottomSurface = Enum.SurfaceType.Smooth
- LArmBase.TopSurface = Enum.SurfaceType.Smooth
- LArmBase.Parent = PlayerFolder
- local RArmBase = Instance.new("Part")
- RArmBase.Transparency = 1
- RArmBase.Name = "RArmBase"
- RArmBase.CanCollide = false
- RArmBase.FormFactor = Enum.FormFactor.Custom
- RArmBase.Size = VEC3(0.2, 0.2, 0.2)
- RArmBase.BottomSurface = Enum.SurfaceType.Smooth
- RArmBase.TopSurface = Enum.SurfaceType.Smooth
- RArmBase.Parent = PlayerFolder
- LWeld = Instance.new("Weld")
- LWeld.Name = "LWeld"
- LWeld.Part0 = ArmBase
- LWeld.Part1 = LArmBase
- LWeld.C0 = ArmC0[1]
- LWeld.C1 = S.ArmC1_UnAimed.Left
- LWeld.Parent = ArmBase
- RWeld = Instance.new("Weld")
- RWeld.Name = "RWeld"
- RWeld.Part0 = ArmBase
- RWeld.Part1 = RArmBase
- RWeld.C0 = ArmC0[2]
- RWeld.C1 = S.ArmC1_UnAimed.Right
- RWeld.Parent = ArmBase
- LWeld2 = Instance.new("Weld")
- LWeld2.Name = "LWeld"
- LWeld2.Part0 = LArmBase
- LWeld2.Part1 = LArm
- LWeld2.Parent = LArmBase
- RWeld2 = Instance.new("Weld")
- RWeld2.Name = "RWeld"
- RWeld2.Part0 = RArmBase
- RWeld2.Part1 = RArm
- RWeld2.Parent = RArmBase
- if S.PlayerArms then
- FakeLArm = LArm:Clone()
- FakeLArm.Parent = PlayerFolder
- FakeLArm.Transparency = S.FakeArmTransparency
- FakeLArm:BreakJoints()
- LArm.Transparency = 1
- local FakeLWeld = Instance.new("Weld")
- FakeLWeld.Part0 = FakeLArm
- FakeLWeld.Part1 = LArm
- FakeLWeld.Parent = FakeLArm
- FakeRArm = RArm:Clone()
- FakeRArm.Parent = PlayerFolder
- FakeRArm.Transparency = S.FakeArmTransparency
- FakeRArm:BreakJoints()
- RArm.Transparency = 1
- local FakeRWeld = Instance.new("Weld")
- FakeRWeld.Part0 = FakeRArm
- FakeRWeld.Part1 = RArm
- FakeRWeld.Parent = FakeRArm
- Instance.new("Humanoid", PlayerFolder)
- for _,Obj in pairs(Character:GetChildren()) do
- if Obj:IsA("CharacterMesh") or Obj:IsA("Shirt") then
- Obj:Clone().Parent = PlayerFolder
- end
- end
- else
- local ArmTable = CreateArms()
- ArmTable[1].Model.Parent = PlayerFolder
- ArmTable[2].Model.Parent = PlayerFolder
- FakeLArm = ArmTable[1].ArmPart
- LArm.Transparency = 1
- local FakeLWeld = Instance.new("Weld")
- FakeLWeld.Part0 = FakeLArm
- FakeLWeld.Part1 = LArm
- FakeLWeld.Parent = FakeLArm
- FakeRArm = ArmTable[2].ArmPart
- RArm.Transparency = 1
- local FakeRWeld = Instance.new("Weld")
- FakeRWeld.Part0 = FakeRArm
- FakeRWeld.Part1 = RArm
- FakeRWeld.Parent = FakeRArm
- end
- --------------------[ MODIFYING THE GUN ]-------------------------------------
- for _, Tab in pairs(Parts) do
- local Weld = Instance.new("Weld")
- Weld.Name = "MainWeld"
- Weld.Part0 = Handle
- Weld.Part1 = Tab.Obj
- Weld.C0 = Tab.Obj.WeldCF.Value
- Weld.Parent = Handle
- Tab.Weld = Weld
- end
- Grip = RArm:WaitForChild("RightGrip")
- local HandleCF = ArmBase.CFrame * ArmC0[2] * S.ArmC1_Aimed.Right:inverse() * CF(0, -1, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
- local HandleOffset = AimPart.CFrame:toObjectSpace(Handle.CFrame)
- Aimed_GripCF = (Head.CFrame * HandleOffset):toObjectSpace(HandleCF)
- --------------------[ CONNECTIONS ]-------------------------------------------
- INSERT(Connections, Humanoid.Died:connect(function()
- OnUnequipped(true)
- end))
- INSERT(Connections, M2.Button1Down:connect(function()
- MB1_Down = true
- if S.GunType.Auto and (not S.GunType.Semi) and (not S.GunType.Burst) then
- if (not CanFire) then return end
- CanFire = false
- if (not Running) and (not Knifing) and (not ThrowingGrenade) then
- CurrentSpread = (
- Aimed and S.Spread.Aimed or
- ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
- )
- while MB1_Down and (not Reloading) do
- if Knifing and (not ThrowingGrenade) then break end
- if Running then break end
- if Ammo.Value > 0 then
- Ammo.Value = Ammo.Value - 1
- if Humanoid.Health ~= 0 then
- if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
- Run_Key_Pressed = false
- CurrentSteadyTime = 0
- end
- Fire_Gun()
- end
- end
- if Ammo.Value == 0 and S.AutoReload then
- wait(0.2)
- Reload()
- end
- wait(60 / S.FireRate)
- end
- end
- CanFire = true
- elseif (not S.GunType.Auto) and S.GunType.Burst then
- if (not CanFire) then return end
- CanFire = false
- if (not Running) and (not Knifing) and (not ThrowingGrenade) then
- CurrentSpread = (
- Aimed and S.Spread.Aimed or
- ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
- )
- for i = 1, S.BurstAmount do
- if Ammo.Value > 0 then
- Ammo.Value = Ammo.Value - 1
- if Humanoid.Health ~= 0 then
- if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
- Run_Key_Pressed = false
- CurrentSteadyTime = 0
- end
- Fire_Gun()
- end
- end
- if Ammo.Value == 0 and S.AutoReload then
- wait(0.2)
- Reload()
- break
- end
- wait(S.BurstTime / S.BurstAmount)
- end
- end
- wait(S.BurstWait)
- CanFire = true
- elseif (not S.GunType.Auto) and S.GunType.Semi then
- if (not CanFire) then return end
- CanFire = false
- if (not Running) and (not Knifing) and (not ThrowingGrenade) then
- CurrentSpread = (
- Aimed and S.Spread.Aimed or
- ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
- )
- if Ammo.Value > 0 then
- Ammo.Value = Ammo.Value - 1
- if Humanoid.Health ~= 0 then
- if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
- Run_Key_Pressed = false
- CurrentSteadyTime = 0
- end
- Fire_Gun()
- end
- end
- if Ammo.Value == 0 and S.AutoReload then
- wait(0.2)
- Reload()
- end
- wait(60 / S.FireRate)
- end
- CanFire = true
- elseif (not S.GunType.Auto) and (not S.GunType.Semi) and (not S.GunType.Burst) and S.GunType.Shot then
- if (not CanFire) then return end
- CanFire = false
- if (not Running) and (not Knifing) and (not ThrowingGrenade) then
- CurrentSpread = (
- Aimed and S.Spread.Aimed or
- ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
- )
- if Ammo.Value > 0 then
- Ammo.Value = Ammo.Value - 1
- if Humanoid.Health ~= 0 then
- if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
- Run_Key_Pressed = false
- CurrentSteadyTime = 0
- end
- Fire_Gun()
- end
- end
- if Ammo.Value == 0 and S.AutoReload then
- wait(0.2)
- Reload()
- end
- wait(60 / S.FireRate)
- end
- CanFire = true
- elseif (not S.GunType.Auto) and (not S.GunType.Semi) and S.GunType.Burst and (not S.GunType.Shot) then
- if (not CanFire) then return end
- CanFire = false
- if (not Running) and (not Knifing) and (not ThrowingGrenade) then
- CurrentSpread = (
- Aimed and S.Spread.Aimed or
- ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
- )
- for i = 1, S.BurstAmount do
- if Ammo.Value > 0 then
- Ammo.Value = Ammo.Value - 1
- if Humanoid.Health ~= 0 then
- if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
- Run_Key_Pressed = false
- CurrentSteadyTime = 0
- end
- Fire_Gun()
- end
- end
- if Ammo.Value == 0 and S.AutoReload then
- wait(0.2)
- Reload()
- break
- end
- wait(S.BurstTime / S.BurstAmount)
- end
- end
- wait(S.BurstWait)
- CanFire = true
- elseif (not S.GunType.Auto) and (not S.GunType.Burst) and (not S.GunType.Shot) and S.GunType.Explosive then
- if (not CanFire) then return end
- CanFire = false
- if (not Running) and (not Knifing) and (not ThrowingGrenade) then
- CurrentSpread = (
- Aimed and S.Spread.Aimed or
- ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
- )
- if Ammo.Value > 0 then
- Ammo.Value = Ammo.Value - 1
- if Humanoid.Health ~= 0 then
- if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
- Run_Key_Pressed = false
- CurrentSteadyTime = 0
- end
- Fire_Gun()
- end
- end
- if Ammo.Value == 0 and S.AutoReload then
- wait(0.2)
- Reload()
- end
- wait(60 / S.FireRate)
- end
- CanFire = true
- end
- end))
- INSERT(Connections, M2.Button1Up:connect(function()
- MB1_Down = false
- CurrentSpread = (
- Aimed and S.Spread.Aimed or
- ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
- )
- end))
- INSERT(Connections, M2.Button2Down:connect(function()
- if S.HoldMouseOrKeyToADS then
- if (not AimingIn) and (not Aimed) then
- AimingIn = true
- AimGun()
- AimingIn = false
- end
- else
- if Aimed then
- UnAimGun()
- else
- AimGun()
- end
- end
- end))
- INSERT(Connections, M2.Button2Up:connect(function()
- if S.HoldMouseOrKeyToADS then
- if (not AimingOut) and Aimed then
- AimingOut = true
- UnAimGun()
- AimingOut = false
- end
- end
- end))
- INSERT(Connections, M2.KeyDown:connect(KeyDown))
- INSERT(Connections, M2.KeyUp:connect(KeyUp))
- INSERT(Connections, RS:connect(function()
- local CrossHair = Gui_Clone:WaitForChild("CrossHair")
- local HitMarker = Gui_Clone:WaitForChild("HitMarker")
- local HUD = Gui_Clone:WaitForChild("HUD")
- CrossHair.Position = UDim2.new(0, M2.X, 0, M2.Y)
- HitMarker.Position = UDim2.new(0, M2.X - 13, 0, M2.Y - 13)
- local Clip_Ammo_L = HUD:WaitForChild("Ammo"):WaitForChild("Clip")
- local Stored_Ammo_L = HUD:WaitForChild("Ammo"):WaitForChild("Stored")
- Clip_Ammo_L.Text = Ammo.Value
- Clip_Ammo_L.TextColor3 = (Ammo.Value <= (ClipSize.Value / 3) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
- Stored_Ammo_L.Text = StoredAmmo.Value
- Stored_Ammo_L.TextColor3 = (StoredAmmo.Value <= (ClipSize.Value * 2) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
- local Lethal_Grenade_Num_L = HUD:WaitForChild("Grenades"):WaitForChild("Lethals"):WaitForChild("Num")
- Lethal_Grenade_Num_L.Text = LethalGrenades.Value
- Lethal_Grenade_Num_L.TextColor3 = (LethalGrenades.Value < 3 and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
- local Tactical_Grenade_Num_L = HUD:WaitForChild("Grenades"):WaitForChild("Tacticals"):WaitForChild("Num")
- Tactical_Grenade_Num_L.Text = TacticalGrenades.Value
- Tactical_Grenade_Num_L.TextColor3 = (TacticalGrenades.Value < 3 and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
- local Mode = HUD:WaitForChild("Mode"):WaitForChild("Main")
- if S.GunType.Auto
- and (not S.GunType.Semi)
- and (not S.GunType.Burst)
- and (not S.GunType.Explosive) then
- Mode.Text = "Auto"
- elseif (not S.GunType.Auto)
- and S.GunType.Burst
- and (not S.GunType.Explosive) then
- Mode.Text = "Burst"
- elseif (not S.GunType.Auto)
- and S.GunType.Semi
- and (not S.GunType.Explosive) then
- Mode.Text = "Semi"
- elseif (not S.GunType.Auto)
- and (not S.GunType.Semi)
- and (not S.GunType.Burst)
- and S.GunType.Shot
- and (not S.GunType.Explosive) then
- Mode.Text = "Shotgun"
- elseif (not S.GunType.Auto)
- and (not S.GunType.Semi)
- and S.GunType.Burst
- and (not S.GunType.Shot)
- and (not S.GunType.Explosive) then
- Mode.Text = "Burst"
- elseif S.GunType.Explosive then
- Mode.Text = "Explosive"
- end
- if tick() - LastBeat > (Humanoid.Health / 75) then
- LastBeat = tick()
- HUD.Health.Tray.Beat:TweenPosition(
- UDim2.new(0, -21, 0, 0),
- Enum.EasingDirection.Out,
- Enum.EasingStyle.Linear,
- 0.7 - ((100 - Humanoid.Health) / 400),
- false,
- function()
- HUD.Health.Tray.Beat.Position = UDim2.new(1, 0, 0, 0)
- end
- )
- end
- HUD.Health.Num.Text = CEIL(Humanoid.Health).."%"
- HUD.Health.Num.TextColor3 = (
- (Humanoid.Health > 200 / 3) and Color3.new(1, 1, 1) or
- (Humanoid.Health <= 200 / 3 and Humanoid.Health > 100 / 3) and Color3.new(1, 1, 0) or
- (Humanoid.Health <= 100 / 3) and Color3.new(1, 0, 0)
- )
- end))
- INSERT(Connections, RS:connect(function()
- local MDir = M2.UnitRay.Direction.unit
- local HRPCF = HRP.CFrame * CF(0, 1.5, 0) * CF(Humanoid.CameraOffset)
- Neck.C0 = Torso.CFrame:toObjectSpace(HRPCF)
- if MDir.y == MDir.y then
- HeadRot = -math.asin(MDir.y)
- Neck.C1 = CFANG(HeadRot,0,0)
- local RotTarget = VEC3(MDir.x,0,MDir.z)
- local Rotation = CF(Torso.Position,Torso.Position + RotTarget)
- BG.cframe = Rotation
- local MouseX = FLOOR((M2.X - M2.ViewSizeX / 2) + 0.5)
- local MouseY = FLOOR((M2.Y - M2.ViewSizeY / 2) + 0.5)
- local AppliedMaxTorque = nil
- if (Camera.CoordinateFrame.p - Head.Position).magnitude < 0.6 then
- if (MouseX >= 50 or MouseX <= -50)
- or (MouseY >= 50 or MouseY <= -50) then
- AppliedMaxTorque = VEC3()
- else
- AppliedMaxTorque = VEC3(HUGE,HUGE,HUGE)
- end
- else
- AppliedMaxTorque = VEC3(HUGE,HUGE,HUGE)
- end
- if (not S.RotateWhileSitting) and Humanoid.Sit then
- AppliedMaxTorque = VEC3()
- end
- BG.maxTorque = AppliedMaxTorque
- end
- end))
- INSERT(Connections, RS:connect(function()
- local Forward = (Keys["w"] or Keys[string.char(17)])
- local Backward = (Keys["s"] or Keys[string.char(18)])
- local Right = (Keys["d"] or Keys[string.char(19)])
- local Left = (Keys["a"] or Keys[string.char(20)])
- local WalkingForward = (Forward and (not Backward))
- local WalkingBackward = ((not Forward) and Backward)
- local WalkingRight = (Right and (not Left))
- local WalkingLeft = ((not Right) and Left)
- ArmTilt = (
- ((WalkingForward or WalkingBackward) and WalkingRight) and 5 or
- ((WalkingForward or WalkingBackward) and WalkingLeft) and -5 or
- ((not (WalkingForward and WalkingBackward)) and WalkingRight) and 10 or
- ((not (WalkingForward and WalkingBackward)) and WalkingLeft) and -10 or 0
- )
- end))
- INSERT(Connections, RS:connect(function()
- if (not Idleing) and Walking then
- if Running then
- Humanoid.WalkSpeed = S.SprintSpeed
- else
- local SpeedRatio = (S.AimedWalkSpeed / S.BaseWalkSpeed)
- if Stance == 0 then
- Humanoid.WalkSpeed = (Aimed and S.AimedWalkSpeed or S.BaseWalkSpeed)
- elseif Stance == 1 then
- Humanoid.WalkSpeed = (Aimed and S.CrouchWalkSpeed * SpeedRatio or S.CrouchWalkSpeed)
- elseif Stance == 2 then
- Humanoid.WalkSpeed = (Aimed and S.ProneWalkSpeed * SpeedRatio or S.ProneWalkSpeed)
- end
- end
- else
- Humanoid.WalkSpeed = 16
- end
- StanceSway = 1 - (0.25 * Stance)
- end))
- --------------------[ ANIMATE GUN ]-------------------------------------------
- Animate()
- end
- end
- function OnUnequipped(DeleteTool)
- if Selected then
- Selected = false
- BreakReload = true
- --------------------[ MODIFYING THE PLAYER ]----------------------------------
- Camera.FieldOfView = 70
- game:GetService("UserInputService").MouseIconEnabled = true
- Gui_Clone:Destroy()
- BG:Destroy()
- RArm.Transparency = 0
- LArm.Transparency = 0
- Shoulders.Right.Part1 = RArm
- Shoulders.Left.Part1 = LArm
- Neck.C0 = PrevNeckCF.C0
- Neck.C1 = PrevNeckCF.C1
- Humanoid.WalkSpeed = 16
- --------------------[ RESETING THE TOOL ]-------------------------------------
- Gun_Ignore:Destroy()
- Aimed = false
- for _, Tab in pairs(Parts) do
- Tab.Weld:Destroy()
- Tab.Weld = nil
- end
- for _,c in pairs(Connections) do
- c:disconnect()
- end
- Connections = {}
- if DeleteTool then
- Camera:ClearAllChildren()
- Gun:Destroy()
- end
- if S.StandOnDeselect and Stance ~= 0 then Stand(true) end
- end
- end
- Gun.Equipped:connect(OnEquipped)
- Gun.Unequipped:connect(function() OnUnequipped(false) end)
- --------------------------------------------------------------------------------------
- --------------------[ END PROGRAM ]---------------------------------------------------
- --------------------------------------------------------------------------------------
- end))
- IntValue18.Name = "Ignore_Code"
- IntValue18.Parent = LocalScript17
- ScreenGui19.Name = "Main_Gui"
- ScreenGui19.Parent = LocalScript17
- ImageLabel20.Name = "HitMarker"
- ImageLabel20.Parent = ScreenGui19
- ImageLabel20.Transparency = 1
- ImageLabel20.Size = UDim2.new(0, 26, 0, 26)
- ImageLabel20.Position = UDim2.new(0.5, -13, 0.5, -13)
- ImageLabel20.Visible = false
- ImageLabel20.BackgroundTransparency = 1
- ImageLabel20.ZIndex = 10
- ImageLabel20.Image = "http://www.roblox.com/asset/?id=121173757"
- Frame21.Name = "CrossHair"
- Frame21.Parent = ScreenGui19
- Frame21.Position = UDim2.new(0.5, 0, 0.5, 0)
- Frame21.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame21.BorderColor3 = Color3.new(0, 0, 0)
- Frame21.BorderSizePixel = 0
- ImageLabel22.Parent = Frame21
- ImageLabel22.Transparency = 1
- ImageLabel22.Size = UDim2.new(0, 300, 0, 300)
- ImageLabel22.Position = UDim2.new(0, -150, 0, -150)
- ImageLabel22.Visible = false
- ImageLabel22.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel22.BackgroundTransparency = 1
- ImageLabel22.ZIndex = 2
- ImageLabel22.Image = "http://www.roblox.com/asset/?id=68308747"
- Frame23.Name = "Box"
- Frame23.Parent = Frame21
- Frame23.Transparency = 1
- Frame23.Size = UDim2.new(0, 70, 0, 70)
- Frame23.Position = UDim2.new(0, -35, 0, -35)
- Frame23.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame23.BackgroundTransparency = 1
- Frame23.ClipsDescendants = true
- TextLabel24.Name = "Line"
- TextLabel24.Parent = Frame23
- TextLabel24.Size = UDim2.new(0, 2, 0, 25)
- TextLabel24.Text = ""
- TextLabel24.Position = UDim2.new(0.5, -1, 1, -25)
- TextLabel24.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel24.BorderColor3 = Color3.new(0, 0, 0)
- TextLabel24.BorderSizePixel = 0
- TextLabel24.Font = Enum.Font.SourceSans
- TextLabel24.FontSize = Enum.FontSize.Size14
- TextLabel25.Name = "Line"
- TextLabel25.Parent = Frame23
- TextLabel25.Size = UDim2.new(0, 2, 0, 25)
- TextLabel25.Text = ""
- TextLabel25.Position = UDim2.new(0.5, -1, 0, 0)
- TextLabel25.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel25.BorderColor3 = Color3.new(0, 0, 0)
- TextLabel25.BorderSizePixel = 0
- TextLabel25.Font = Enum.Font.SourceSans
- TextLabel25.FontSize = Enum.FontSize.Size14
- TextLabel26.Name = "Line"
- TextLabel26.Parent = Frame23
- TextLabel26.Size = UDim2.new(0, 25, 0, 2)
- TextLabel26.Text = ""
- TextLabel26.Position = UDim2.new(1, -25, 0.5, -1)
- TextLabel26.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel26.BorderColor3 = Color3.new(0, 0, 0)
- TextLabel26.BorderSizePixel = 0
- TextLabel26.Font = Enum.Font.SourceSans
- TextLabel26.FontSize = Enum.FontSize.Size14
- TextLabel27.Name = "Line"
- TextLabel27.Parent = Frame23
- TextLabel27.Size = UDim2.new(0, 25, 0, 2)
- TextLabel27.Text = ""
- TextLabel27.Position = UDim2.new(0, 0, 0.5, -1)
- TextLabel27.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel27.BorderColor3 = Color3.new(0, 0, 0)
- TextLabel27.BorderSizePixel = 0
- TextLabel27.Font = Enum.Font.SourceSans
- TextLabel27.FontSize = Enum.FontSize.Size14
- TextLabel28.Name = "Reload"
- TextLabel28.Parent = Frame21
- TextLabel28.Transparency = 1
- TextLabel28.Size = UDim2.new(0, 100, 0, 20)
- TextLabel28.Text = "Reloading..."
- TextLabel28.Position = UDim2.new(0, -50, 0, 70)
- TextLabel28.Visible = false
- TextLabel28.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel28.BackgroundTransparency = 1
- TextLabel28.ZIndex = 2
- TextLabel28.Font = Enum.Font.ArialBold
- TextLabel28.FontSize = Enum.FontSize.Size18
- TextLabel28.TextColor3 = Color3.new(1, 1, 1)
- TextLabel28.TextStrokeTransparency = 0.5
- Frame29.Name = "HUD"
- Frame29.Parent = ScreenGui19
- Frame29.Transparency = 0.30000001192093
- Frame29.Size = UDim2.new(0, 175, 0, 75)
- Frame29.Position = UDim2.new(1, -200, 1, -125)
- Frame29.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
- Frame29.BackgroundTransparency = 0.30000001192093
- Frame29.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
- Frame29.BorderSizePixel = 5
- Frame30.Name = "Ammo"
- Frame30.Parent = Frame29
- Frame30.Transparency = 1
- Frame30.Size = UDim2.new(0, 175, 0, 50)
- Frame30.BackgroundTransparency = 1
- TextLabel31.Name = "Slash"
- TextLabel31.Parent = Frame30
- TextLabel31.Transparency = 1
- TextLabel31.Size = UDim2.new(0, 10, 0, 30)
- TextLabel31.Text = "/"
- TextLabel31.Position = UDim2.new(0, 95, 0, 0)
- TextLabel31.BackgroundTransparency = 1
- TextLabel31.ZIndex = 10
- TextLabel31.Font = Enum.Font.ArialBold
- TextLabel31.FontSize = Enum.FontSize.Size36
- TextLabel31.TextColor3 = Color3.new(1, 1, 1)
- TextLabel32.Name = "Stored"
- TextLabel32.Parent = Frame30
- TextLabel32.Transparency = 1
- TextLabel32.Size = UDim2.new(0, 55, 0, 30)
- TextLabel32.Text = "124"
- TextLabel32.Position = UDim2.new(0, 115, 0, 0)
- TextLabel32.BackgroundTransparency = 1
- TextLabel32.ZIndex = 10
- TextLabel32.Font = Enum.Font.Arial
- TextLabel32.FontSize = Enum.FontSize.Size36
- TextLabel32.TextColor3 = Color3.new(1, 1, 1)
- TextLabel32.TextXAlignment = Enum.TextXAlignment.Left
- TextLabel33.Name = "Background"
- TextLabel33.Parent = TextLabel32
- TextLabel33.Transparency = 1
- TextLabel33.Size = UDim2.new(1, 0, 1, 0)
- TextLabel33.Text = "000"
- TextLabel33.BackgroundTransparency = 1
- TextLabel33.ZIndex = 10
- TextLabel33.Font = Enum.Font.Arial
- TextLabel33.FontSize = Enum.FontSize.Size36
- TextLabel33.TextColor3 = Color3.new(0.588235, 0.588235, 0.588235)
- TextLabel33.TextTransparency = 0.80000001192093
- TextLabel33.TextWrapped = true
- TextLabel33.TextXAlignment = Enum.TextXAlignment.Left
- TextLabel34.Name = "Clip"
- TextLabel34.Parent = Frame30
- TextLabel34.Transparency = 1
- TextLabel34.Size = UDim2.new(0, 85, 0, 50)
- TextLabel34.Text = "100"
- TextLabel34.BackgroundTransparency = 1
- TextLabel34.ZIndex = 10
- TextLabel34.FontSize = Enum.FontSize.Size36
- TextLabel34.TextColor3 = Color3.new(1, 1, 1)
- TextLabel34.TextXAlignment = Enum.TextXAlignment.Right
- TextLabel35.Name = "Background"
- TextLabel35.Parent = TextLabel34
- TextLabel35.Transparency = 1
- TextLabel35.Size = UDim2.new(1, 0, 1, 0)
- TextLabel35.Text = "000"
- TextLabel35.BackgroundTransparency = 1
- TextLabel35.ZIndex = 10
- TextLabel35.FontSize = Enum.FontSize.Size36
- TextLabel35.TextColor3 = Color3.new(0.588235, 0.588235, 0.588235)
- TextLabel35.TextTransparency = 0.80000001192093
- TextLabel35.TextXAlignment = Enum.TextXAlignment.Right
- Frame36.Name = "Mode"
- Frame36.Parent = Frame29
- Frame36.Transparency = 1
- Frame36.Size = UDim2.new(0, 80, 0, 20)
- Frame36.Position = UDim2.new(0, 95, 0, 27)
- Frame36.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame36.BackgroundTransparency = 1
- TextLabel37.Name = "Bracket"
- TextLabel37.Parent = Frame36
- TextLabel37.Transparency = 1
- TextLabel37.Size = UDim2.new(0, 5, 0, 20)
- TextLabel37.Text = "["
- TextLabel37.BackgroundTransparency = 1
- TextLabel37.ZIndex = 10
- TextLabel37.Font = Enum.Font.ArialBold
- TextLabel37.FontSize = Enum.FontSize.Size18
- TextLabel37.TextColor3 = Color3.new(1, 1, 1)
- TextLabel37.TextWrapped = true
- TextLabel37.TextXAlignment = Enum.TextXAlignment.Left
- TextLabel38.Name = "Bracket"
- TextLabel38.Parent = Frame36
- TextLabel38.Transparency = 1
- TextLabel38.Size = UDim2.new(0, 5, 0, 20)
- TextLabel38.Text = "]"
- TextLabel38.Position = UDim2.new(1, -5, 0, 0)
- TextLabel38.BackgroundTransparency = 1
- TextLabel38.ZIndex = 10
- TextLabel38.Font = Enum.Font.ArialBold
- TextLabel38.FontSize = Enum.FontSize.Size18
- TextLabel38.TextColor3 = Color3.new(1, 1, 1)
- TextLabel38.TextWrapped = true
- TextLabel38.TextXAlignment = Enum.TextXAlignment.Left
- TextLabel39.Name = "Main"
- TextLabel39.Parent = Frame36
- TextLabel39.Transparency = 1
- TextLabel39.Size = UDim2.new(1, 0, 0, 20)
- TextLabel39.Text = "Auto"
- TextLabel39.BackgroundTransparency = 1
- TextLabel39.ZIndex = 10
- TextLabel39.Font = Enum.Font.SourceSansBold
- TextLabel39.FontSize = Enum.FontSize.Size18
- TextLabel39.TextColor3 = Color3.new(1, 1, 1)
- TextLabel39.TextWrapped = true
- Frame40.Name = "Health"
- Frame40.Parent = Frame29
- Frame40.Transparency = 0.30000001192093
- Frame40.Size = UDim2.new(1, 0, 0, 25)
- Frame40.Position = UDim2.new(0, 0, 0, -40)
- Frame40.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
- Frame40.BackgroundTransparency = 0.30000001192093
- Frame40.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
- Frame40.BorderSizePixel = 5
- TextLabel41.Name = "Num"
- TextLabel41.Parent = Frame40
- TextLabel41.Transparency = 1
- TextLabel41.Size = UDim2.new(0, 50, 1, 0)
- TextLabel41.Text = "100%"
- TextLabel41.Position = UDim2.new(1, -50, 0, 0)
- TextLabel41.BackgroundColor3 = Color3.new(0, 0, 0)
- TextLabel41.BackgroundTransparency = 1
- TextLabel41.BorderColor3 = Color3.new(0, 0, 0)
- TextLabel41.BorderSizePixel = 0
- TextLabel41.ZIndex = 10
- TextLabel41.Font = Enum.Font.ArialBold
- TextLabel41.FontSize = Enum.FontSize.Size24
- TextLabel41.TextColor3 = Color3.new(1, 1, 1)
- TextLabel41.TextXAlignment = Enum.TextXAlignment.Right
- Frame42.Name = "Tray"
- Frame42.Parent = Frame40
- Frame42.Transparency = 1
- Frame42.Size = UDim2.new(1, -60, 0, 20)
- Frame42.Position = UDim2.new(0, 2, 0.5, -10)
- Frame42.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame42.BackgroundTransparency = 1
- Frame42.BorderColor3 = Color3.new(0, 0, 0)
- Frame42.BorderSizePixel = 0
- Frame42.ZIndex = 10
- Frame42.ClipsDescendants = true
- Frame43.Name = "Beat"
- Frame43.Parent = Frame42
- Frame43.Transparency = 1
- Frame43.Size = UDim2.new(0, 21, 1, 0)
- Frame43.Position = UDim2.new(1, 0, 0, 0)
- Frame43.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame43.BackgroundTransparency = 1
- Frame43.BorderColor3 = Color3.new(0, 0, 0)
- Frame43.BorderSizePixel = 0
- Frame43.ZIndex = 10
- Frame44.Name = "00"
- Frame44.Parent = Frame43
- Frame44.Size = UDim2.new(0.0476190485, 0, 0, 3)
- Frame44.Position = UDim2.new(0, 0, 0.5, -2)
- Frame44.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame44.BorderColor3 = Color3.new(0, 0, 0)
- Frame44.BorderSizePixel = 0
- Frame44.ZIndex = 10
- Frame45.Name = "01"
- Frame45.Parent = Frame43
- Frame45.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame45.Position = UDim2.new(0.0476190485, 0, 0.423076928, -2)
- Frame45.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame45.BorderColor3 = Color3.new(0, 0, 0)
- Frame45.BorderSizePixel = 0
- Frame45.ZIndex = 10
- Frame46.Name = "02"
- Frame46.Parent = Frame43
- Frame46.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame46.Position = UDim2.new(0.095238097, 0, 0.346153855, -2)
- Frame46.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame46.BorderColor3 = Color3.new(0, 0, 0)
- Frame46.BorderSizePixel = 0
- Frame46.ZIndex = 10
- Frame47.Name = "03"
- Frame47.Parent = Frame43
- Frame47.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame47.Position = UDim2.new(0.142857149, 0, 0.269230783, -2)
- Frame47.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame47.BorderColor3 = Color3.new(0, 0, 0)
- Frame47.BorderSizePixel = 0
- Frame47.ZIndex = 10
- Frame48.Name = "04"
- Frame48.Parent = Frame43
- Frame48.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame48.Position = UDim2.new(0.190476194, 0, 0.192307696, -2)
- Frame48.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame48.BorderColor3 = Color3.new(0, 0, 0)
- Frame48.BorderSizePixel = 0
- Frame48.ZIndex = 10
- Frame49.Name = "05"
- Frame49.Parent = Frame43
- Frame49.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame49.Position = UDim2.new(0.238095239, 0, 0.115384616, -2)
- Frame49.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame49.BorderColor3 = Color3.new(0, 0, 0)
- Frame49.BorderSizePixel = 0
- Frame49.ZIndex = 10
- Frame50.Name = "06"
- Frame50.Parent = Frame43
- Frame50.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame50.Position = UDim2.new(0.285714298, 0, 0.0384615399, -2)
- Frame50.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame50.BorderColor3 = Color3.new(0, 0, 0)
- Frame50.BorderSizePixel = 0
- Frame50.ZIndex = 10
- Frame51.Name = "07"
- Frame51.Parent = Frame43
- Frame51.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame51.Position = UDim2.new(0.333333343, 0, 0, -2)
- Frame51.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame51.BorderColor3 = Color3.new(0, 0, 0)
- Frame51.BorderSizePixel = 0
- Frame51.ZIndex = 10
- Frame52.Name = "08"
- Frame52.Parent = Frame43
- Frame52.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame52.Position = UDim2.new(0.380952388, 0, 0.142857149, -2)
- Frame52.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame52.BorderColor3 = Color3.new(0, 0, 0)
- Frame52.BorderSizePixel = 0
- Frame52.ZIndex = 10
- Frame53.Name = "09"
- Frame53.Parent = Frame43
- Frame53.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame53.Position = UDim2.new(0.428571433, 0, 0.285714298, -2)
- Frame53.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame53.BorderColor3 = Color3.new(0, 0, 0)
- Frame53.BorderSizePixel = 0
- Frame53.ZIndex = 10
- Frame54.Name = "10"
- Frame54.Parent = Frame43
- Frame54.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame54.Position = UDim2.new(0.476190478, 0, 0.428571433, -2)
- Frame54.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame54.BorderColor3 = Color3.new(0, 0, 0)
- Frame54.BorderSizePixel = 0
- Frame54.ZIndex = 10
- Frame55.Name = "11"
- Frame55.Parent = Frame43
- Frame55.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame55.Position = UDim2.new(0.523809552, 0, 0.571428597, -2)
- Frame55.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame55.BorderColor3 = Color3.new(0, 0, 0)
- Frame55.BorderSizePixel = 0
- Frame55.ZIndex = 10
- Frame56.Name = "12"
- Frame56.Parent = Frame43
- Frame56.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame56.Position = UDim2.new(0.571428597, 0, 0.714285731, -2)
- Frame56.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame56.BorderColor3 = Color3.new(0, 0, 0)
- Frame56.BorderSizePixel = 0
- Frame56.ZIndex = 10
- Frame57.Name = "13"
- Frame57.Parent = Frame43
- Frame57.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame57.Position = UDim2.new(0.619047642, 0, 0.857142866, -2)
- Frame57.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame57.BorderColor3 = Color3.new(0, 0, 0)
- Frame57.BorderSizePixel = 0
- Frame57.ZIndex = 10
- Frame58.Name = "14"
- Frame58.Parent = Frame43
- Frame58.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame58.Position = UDim2.new(0.666666687, 0, 0.916666687, -2)
- Frame58.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame58.BorderColor3 = Color3.new(0, 0, 0)
- Frame58.BorderSizePixel = 0
- Frame58.ZIndex = 10
- Frame59.Name = "15"
- Frame59.Parent = Frame43
- Frame59.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame59.Position = UDim2.new(0.714285731, 0, 0.833333313, -2)
- Frame59.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame59.BorderColor3 = Color3.new(0, 0, 0)
- Frame59.BorderSizePixel = 0
- Frame59.ZIndex = 10
- Frame60.Name = "16"
- Frame60.Parent = Frame43
- Frame60.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame60.Position = UDim2.new(0.761904776, 0, 0.75, -2)
- Frame60.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame60.BorderColor3 = Color3.new(0, 0, 0)
- Frame60.BorderSizePixel = 0
- Frame60.ZIndex = 10
- Frame61.Name = "17"
- Frame61.Parent = Frame43
- Frame61.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame61.Position = UDim2.new(0.809523821, 0, 0.666666687, -2)
- Frame61.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame61.BorderColor3 = Color3.new(0, 0, 0)
- Frame61.BorderSizePixel = 0
- Frame61.ZIndex = 10
- Frame62.Name = "18"
- Frame62.Parent = Frame43
- Frame62.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame62.Position = UDim2.new(0.857142866, 0, 0.583333313, -2)
- Frame62.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame62.BorderColor3 = Color3.new(0, 0, 0)
- Frame62.BorderSizePixel = 0
- Frame62.ZIndex = 10
- Frame63.Name = "19"
- Frame63.Parent = Frame43
- Frame63.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame63.Position = UDim2.new(0.90476191, 0, 0.5, -2)
- Frame63.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame63.BorderColor3 = Color3.new(0, 0, 0)
- Frame63.BorderSizePixel = 0
- Frame63.ZIndex = 10
- Frame64.Name = "20"
- Frame64.Parent = Frame43
- Frame64.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame64.Position = UDim2.new(0.952000022, 0, 0.49000001, -2)
- Frame64.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame64.BorderColor3 = Color3.new(0, 0, 0)
- Frame64.BorderSizePixel = 0
- Frame64.ZIndex = 10
- Frame65.Name = "Line"
- Frame65.Parent = Frame43
- Frame65.Size = UDim2.new(0, 200, 0, 3)
- Frame65.Position = UDim2.new(1, 0, 0.5, -2)
- Frame65.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame65.BorderColor3 = Color3.new(0, 0, 0)
- Frame65.BorderSizePixel = 0
- Frame65.ZIndex = 10
- Frame66.Name = "Line"
- Frame66.Parent = Frame43
- Frame66.Size = UDim2.new(0, 200, 0, 3)
- Frame66.Position = UDim2.new(0, -200, 0.5, -2)
- Frame66.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame66.BorderColor3 = Color3.new(0, 0, 0)
- Frame66.BorderSizePixel = 0
- Frame66.ZIndex = 10
- Frame67.Name = "Controls"
- Frame67.Parent = Frame29
- Frame67.Transparency = 0.30000001192093
- Frame67.Size = UDim2.new(1, 0, 0, 120)
- Frame67.Position = UDim2.new(0, 0, 0, -200)
- Frame67.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
- Frame67.BackgroundTransparency = 0.30000001192093
- Frame67.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
- Frame67.BorderSizePixel = 5
- TextLabel68.Name = "Title"
- TextLabel68.Parent = Frame67
- TextLabel68.Transparency = 1
- TextLabel68.Size = UDim2.new(1, 0, 0, 15)
- TextLabel68.Text = "CONTROLS"
- TextLabel68.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel68.BackgroundTransparency = 1
- TextLabel68.Font = Enum.Font.SourceSansBold
- TextLabel68.FontSize = Enum.FontSize.Size14
- TextLabel68.TextColor3 = Color3.new(1, 1, 1)
- TextLabel69.Name = "Line"
- TextLabel69.Parent = TextLabel68
- TextLabel69.Size = UDim2.new(1, 0, 0, 2)
- TextLabel69.Text = ""
- TextLabel69.Position = UDim2.new(0, 0, 1, 1)
- TextLabel69.BackgroundColor3 = Color3.new(1, 1, 0)
- TextLabel69.BorderSizePixel = 0
- TextLabel69.Font = Enum.Font.SourceSans
- TextLabel69.FontSize = Enum.FontSize.Size14
- TextLabel70.Name = "Co"
- TextLabel70.Parent = Frame29
- TextLabel70.Transparency = 1
- TextLabel70.Size = UDim2.new(1, 0, 0, 20)
- TextLabel70.Text = "Gun Kit made by TurboFusion"
- TextLabel70.Position = UDim2.new(0, 0, 1, 5)
- TextLabel70.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel70.BackgroundTransparency = 1
- TextLabel70.Font = Enum.Font.ArialBold
- TextLabel70.FontSize = Enum.FontSize.Size14
- TextLabel70.TextColor3 = Color3.new(1, 1, 0)
- TextLabel70.TextStrokeTransparency = 0
- TextLabel70.TextWrapped = true
- TextLabel70.TextXAlignment = Enum.TextXAlignment.Right
- TextLabel71.Name = "Version"
- TextLabel71.Parent = Frame29
- TextLabel71.Transparency = 1
- TextLabel71.Size = UDim2.new(1, 0, 0, 15)
- TextLabel71.Text = "v0.0.3"
- TextLabel71.Position = UDim2.new(0, 0, 1, 25)
- TextLabel71.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel71.BackgroundTransparency = 1
- TextLabel71.Font = Enum.Font.ArialBold
- TextLabel71.FontSize = Enum.FontSize.Size14
- TextLabel71.TextColor3 = Color3.new(1, 1, 0)
- TextLabel71.TextStrokeTransparency = 0
- TextLabel71.TextWrapped = true
- TextLabel71.TextXAlignment = Enum.TextXAlignment.Right
- Frame72.Name = "Grenades"
- Frame72.Parent = Frame29
- Frame72.Transparency = 1
- Frame72.Size = UDim2.new(0, 175, 0, 25)
- Frame72.Position = UDim2.new(0, 0, 0, 50)
- Frame72.BackgroundTransparency = 1
- Frame73.Name = "Lethals"
- Frame73.Parent = Frame72
- Frame73.Transparency = 1
- Frame73.Size = UDim2.new(0.5, -2, 1, 0)
- Frame73.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame73.BackgroundTransparency = 1
- Frame74.Name = "Lines"
- Frame74.Parent = Frame73
- Frame74.Transparency = 1
- Frame74.Size = UDim2.new(1, 0, 1, 0)
- Frame74.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame74.BackgroundTransparency = 1
- TextLabel75.Name = "Line"
- TextLabel75.Parent = Frame74
- TextLabel75.Size = UDim2.new(1, 0, 0, 2)
- TextLabel75.Text = ""
- TextLabel75.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel75.BorderSizePixel = 0
- TextLabel75.Font = Enum.Font.SourceSans
- TextLabel75.FontSize = Enum.FontSize.Size14
- TextLabel76.Name = "Line"
- TextLabel76.Parent = Frame74
- TextLabel76.Size = UDim2.new(1, 0, 0, 2)
- TextLabel76.Text = ""
- TextLabel76.Position = UDim2.new(0, 0, 1, -2)
- TextLabel76.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel76.BorderSizePixel = 0
- TextLabel76.Font = Enum.Font.SourceSans
- TextLabel76.FontSize = Enum.FontSize.Size14
- TextLabel77.Name = "Line"
- TextLabel77.Parent = Frame74
- TextLabel77.Size = UDim2.new(0, 2, 1, 0)
- TextLabel77.Text = ""
- TextLabel77.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel77.BorderSizePixel = 0
- TextLabel77.Font = Enum.Font.SourceSans
- TextLabel77.FontSize = Enum.FontSize.Size14
- TextLabel78.Name = "Line"
- TextLabel78.Parent = Frame74
- TextLabel78.Size = UDim2.new(0, 2, 1, 0)
- TextLabel78.Text = ""
- TextLabel78.Position = UDim2.new(1, -2, 0, 0)
- TextLabel78.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel78.BorderSizePixel = 0
- TextLabel78.Font = Enum.Font.SourceSans
- TextLabel78.FontSize = Enum.FontSize.Size14
- ImageLabel79.Name = "Icon"
- ImageLabel79.Parent = Frame73
- ImageLabel79.Transparency = 1
- ImageLabel79.Size = UDim2.new(0, 21, 0, 21)
- ImageLabel79.Position = UDim2.new(0, 7, 0, 2)
- ImageLabel79.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel79.BackgroundTransparency = 1
- TextLabel80.Name = "Dash"
- TextLabel80.Parent = Frame73
- TextLabel80.Size = UDim2.new(0, 16, 0, 2)
- TextLabel80.Text = ""
- TextLabel80.Position = UDim2.new(0.5, -8, 0.5, -1)
- TextLabel80.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel80.BorderSizePixel = 0
- TextLabel80.Font = Enum.Font.ArialBold
- TextLabel80.FontSize = Enum.FontSize.Size18
- TextLabel80.TextColor3 = Color3.new(1, 1, 1)
- TextLabel81.Name = "Num"
- TextLabel81.Parent = Frame73
- TextLabel81.Transparency = 1
- TextLabel81.Size = UDim2.new(0, 0, 1, 0)
- TextLabel81.Text = "0"
- TextLabel81.Position = UDim2.new(1, -7, 0, 0)
- TextLabel81.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel81.BackgroundTransparency = 1
- TextLabel81.Font = Enum.Font.ArialBold
- TextLabel81.FontSize = Enum.FontSize.Size18
- TextLabel81.TextColor3 = Color3.new(1, 1, 1)
- TextLabel81.TextXAlignment = Enum.TextXAlignment.Right
- Frame82.Name = "Tacticals"
- Frame82.Parent = Frame72
- Frame82.Transparency = 1
- Frame82.Size = UDim2.new(0.5, -2, 1, 0)
- Frame82.Position = UDim2.new(0.5, 2, 0, 0)
- Frame82.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame82.BackgroundTransparency = 1
- Frame83.Name = "Lines"
- Frame83.Parent = Frame82
- Frame83.Transparency = 1
- Frame83.Size = UDim2.new(1, 0, 1, 0)
- Frame83.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame83.BackgroundTransparency = 1
- TextLabel84.Name = "Line"
- TextLabel84.Parent = Frame83
- TextLabel84.Size = UDim2.new(1, 0, 0, 2)
- TextLabel84.Text = ""
- TextLabel84.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel84.BorderSizePixel = 0
- TextLabel84.Font = Enum.Font.SourceSans
- TextLabel84.FontSize = Enum.FontSize.Size14
- TextLabel85.Name = "Line"
- TextLabel85.Parent = Frame83
- TextLabel85.Size = UDim2.new(1, 0, 0, 2)
- TextLabel85.Text = ""
- TextLabel85.Position = UDim2.new(0, 0, 1, -2)
- TextLabel85.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel85.BorderSizePixel = 0
- TextLabel85.Font = Enum.Font.SourceSans
- TextLabel85.FontSize = Enum.FontSize.Size14
- TextLabel86.Name = "Line"
- TextLabel86.Parent = Frame83
- TextLabel86.Size = UDim2.new(0, 2, 1, 0)
- TextLabel86.Text = ""
- TextLabel86.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel86.BorderSizePixel = 0
- TextLabel86.Font = Enum.Font.SourceSans
- TextLabel86.FontSize = Enum.FontSize.Size14
- TextLabel87.Name = "Line"
- TextLabel87.Parent = Frame83
- TextLabel87.Size = UDim2.new(0, 2, 1, 0)
- TextLabel87.Text = ""
- TextLabel87.Position = UDim2.new(1, -2, 0, 0)
- TextLabel87.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel87.BorderSizePixel = 0
- TextLabel87.Font = Enum.Font.SourceSans
- TextLabel87.FontSize = Enum.FontSize.Size14
- ImageLabel88.Name = "Icon"
- ImageLabel88.Parent = Frame82
- ImageLabel88.Transparency = 1
- ImageLabel88.Size = UDim2.new(0, 21, 0, 21)
- ImageLabel88.Position = UDim2.new(0, 7, 0, 2)
- ImageLabel88.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel88.BackgroundTransparency = 1
- TextLabel89.Name = "Dash"
- TextLabel89.Parent = Frame82
- TextLabel89.Size = UDim2.new(0, 16, 0, 2)
- TextLabel89.Text = ""
- TextLabel89.Position = UDim2.new(0.5, -8, 0.5, -1)
- TextLabel89.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel89.BorderSizePixel = 0
- TextLabel89.Font = Enum.Font.ArialBold
- TextLabel89.FontSize = Enum.FontSize.Size18
- TextLabel89.TextColor3 = Color3.new(1, 1, 1)
- TextLabel90.Name = "Num"
- TextLabel90.Parent = Frame82
- TextLabel90.Transparency = 1
- TextLabel90.Size = UDim2.new(0, 0, 1, 0)
- TextLabel90.Text = "0"
- TextLabel90.Position = UDim2.new(1, -7, 0, 0)
- TextLabel90.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel90.BackgroundTransparency = 1
- TextLabel90.Font = Enum.Font.ArialBold
- TextLabel90.FontSize = Enum.FontSize.Size18
- TextLabel90.TextColor3 = Color3.new(1, 1, 1)
- TextLabel90.TextXAlignment = Enum.TextXAlignment.Right
- Frame91.Name = "Scope"
- Frame91.Parent = ScreenGui19
- Frame91.Transparency = 1
- Frame91.Size = UDim2.new(1, 0, 1, 0)
- Frame91.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame91.BackgroundTransparency = 1
- ImageLabel92.Name = "Img"
- ImageLabel92.Parent = Frame91
- ImageLabel92.Transparency = 1
- ImageLabel92.Size = UDim2.new(1, 0, 1, 0)
- ImageLabel92.BackgroundColor3 = Color3.new(0, 0, 0)
- ImageLabel92.BackgroundTransparency = 1
- ImageLabel92.BorderSizePixel = 0
- ImageLabel92.ImageTransparency = 1
- TextLabel93.Name = "Steady"
- TextLabel93.Parent = Frame91
- TextLabel93.Transparency = 1
- TextLabel93.Size = UDim2.new(0, 120, 0, 20)
- TextLabel93.Text = ""
- TextLabel93.Position = UDim2.new(0.5, -60, 0.5, 50)
- TextLabel93.Visible = false
- TextLabel93.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel93.BackgroundTransparency = 1
- TextLabel93.ZIndex = 2
- TextLabel93.Font = Enum.Font.ArialBold
- TextLabel93.FontSize = Enum.FontSize.Size14
- TextLabel93.TextColor3 = Color3.new(1, 1, 0)
- TextLabel93.TextStrokeTransparency = 0
- Script94.Name = "[[ README ]] (Don't Delete)"
- Script94.Parent = Tool0
- table.insert(cors,sandbox(Script94,function()
- --[[
- VERSION: v0.0.3
- ----------[ UPDATES ]----------------------------------------------------
- Pre-Release: -Added a copyright
- -fixed the issue where you couldn't run when you selected the tool
- -Added an ADS key and allowed ADS to either be toggle or hold
- -Made the Ammo values external so they can be changed by outside scripts
- v0.0.2: -Created new arms for the gun
- -Fixed an issue where the arms would glitch if PlayerAnimations was set to false and the gun was fired
- -Updated credit security
- -Put the Arm cframes in the SETTINGS
- -Made the stance changing animations slightly smoother
- -Added bullet drop
- -Fixed some bullet hit handling code
- -Made the torso being able to rotate while sitting down a setting
- -Added bullet settings
- -Added shockwave settings
- -Added an Explosive guntype
- -Added a version label in the Gui
- v0.0.3: -Added an option to have player arms
- -Added grenades / throwables
- -Fixed the issue where if a player left a server without deselecting the gun, the bullet trails still remained
- -Added Gui Scopes
- -Fixed the issue where the guns would glitch if you switched weapons too fast
- -------------------------------------------------------------------------
- Hello there!
- Glad to know you're using my one and only Gun Kit!
- Even though this kit has many features and is rather advanced, it's pretty easy to use
- There are 4 things that this gun needs in order to function:
- One brick called "AimPart"
- At least one brick called "Mag"
- One brick called "Handle"
- One brick called "Main"
- The AimPart is what the gun will use to aim down the sights. When you aim down your sights, this brick will be in the center
- of the player's head. It basically allows the gun to have any type of sight, which can be placed anywhere on the gun. As long as
- the AimPart is aligned with the sight, the gun will aim down the sights properly.
- (NOTE: Make sure the AimPart is behind the Sight and the FRONT of the AimPart is facing the Sight)
- The Mag is what the gun will move around when you reload the gun. If the mag is made up of more than one brick, make sure those
- bricks are also called "Mag" so that the gun will move them around. If you set ReloadAnimation to false in the SETTINGS, you don't
- need any bricks called "Mag". But if ReloadAnimation is set to true, the gun needs at least one brick called "Mag" or it will break
- The Handle is obviously the most important part of the Gun. Without it, the tool itself wouldn't work. It's that simple
- (NOTE: If you want a sound to play when you fire, name it "FireSound" and place it in the Handle. If you want a sound to play when
- you reload, name it "ReloadSound" and place it in the Handle)
- The Main is the brick where the bullets will originate from. It's also the brick where the flash effects are kept.
- (NOTE: If you want a flash billboardgui to appear when you fire, name it "FlashGui" and place it in the Main. If you want a light
- to flash when you fire, name it "FlashFX" and place it in the Main)
- ----------[ INSTRUCTIONS ]-----------------------------------------------
- HOW TO USE THIS KIT:
- 1) If the gun already has a Handle, make sure it is facing forward. If the gun doesn't have a Handle, create one and place
- it wherever you like, and make sure it is facing forward
- 2) If the gun already has a brick called "AimPart", move it to where you would like, and make sure it is facing the sight.
- If the gun doesn't have a brick called "AimPart", create one and move it where you would like it to be, and make sure
- it is facing the sight
- 3) If the gun already has a brick called "Main", move it to the very front of the gun. If the gun doesn't have a brick
- called "Main", create one and move it to the very front of the gun
- 4) If ReloadAnimation is set to true in the SETTINGS, make sure the gun has at least one brick called "Mag". If
- ReloadAnimation is set to false, the gun doesn't need any bricks called "Mag".
- 5) Open the SETTINGS and edit them however you like
- That's it! Only 5 steps! It's not that complicated, just follow the Directions and it should work fine. If you have any questions /
- comments / concerns, message me.
- ______ ______ __ ______ _ ______
- / _/ _/ /_ __/_ _______/ /_ ____ / ____/_ _______(_)___ ____ / / /
- / // / / / / / / / ___/ __ \/ __ \/ /_ / / / / ___/ / __ \/ __ \ / // /
- / // / / / / /_/ / / / /_/ / /_/ / __/ / /_/ (__ ) / /_/ / / / / / // /
- / // / /_/ \__,_/_/ /_.___/\____/_/ \__,_/____/_/\____/_/ /_/ _/ // /
- /__/__/ /__/__/
- --]]
- wait(math.random(0, 200) / 200) --This is to prevent more than one Ignore_Model from being created
- if _G.Ignore_Code then --If the Ignore_Code already exists, then the script creates the Ignore_Model
- --[[
- The purpose of this is so that every gun in a game that uses this gun kit will share one Ignore_Model. That way,
- bullet trails, bullet holes, and other fake arms will be ignored by the gun which makes the bullets more likely to
- hit a character part
- --]]
- if (not game.Workspace:FindFirstChild("Ignore_Model_".._G.Ignore_Code)) then
- local Ignore_Model = Instance.new("Model")
- Ignore_Model.Name = "Ignore_Model_".._G.Ignore_Code
- Ignore_Model.Parent = game.Workspace
- spawn(function()
- while true do
- Ignore_Model.Parent = game.Workspace
- wait(1 / 20)
- end
- end)
- end
- script.Parent:WaitForChild("Gun_Main"):WaitForChild("Ignore_Code").Value = _G.Ignore_Code
- else
- --[[
- If there isn't already an Ignore_Code, then this creates one. The purpose of it being random is so that if there is
- an Ignore_Model for something else in the game, the script won't end up placing the ignored objects in that Ignore_Model
- --]]
- _G.Ignore_Code = math.random(1, 1e4)
- if (not game.Workspace:FindFirstChild("Ignore_Model_".._G.Ignore_Code)) then
- local Ignore_Model = Instance.new("Model")
- Ignore_Model.Name = "Ignore_Model_".._G.Ignore_Code
- Ignore_Model.Parent = game.Workspace
- spawn(function()
- while true do
- Ignore_Model.Parent = game.Workspace
- wait(1 / 20)
- end
- end)
- end
- script.Parent:WaitForChild("Gun_Main"):WaitForChild("Ignore_Code").Value = _G.Ignore_Code
- end
- spawn(function()
- repeat wait() until _G.Ignore_Code
- local Ignore_Model = game.Workspace:WaitForChild("Ignore_Model_".._G.Ignore_Code)
- while true do
- for _, Gun_Ignore in pairs(Ignore_Model:GetChildren()) do
- if (not game.Players:FindFirstChild(Gun_Ignore.Name:sub(12))) then
- Gun_Ignore:Destroy()
- end
- end
- wait(1 / 20)
- end
- end)
- end))
- IntValue95.Name = "TacticalGrenades"
- IntValue95.Parent = Tool0
- IntValue95.Value = 15
- IntValue96.Name = "StoredAmmo"
- IntValue96.Parent = Tool0
- IntValue96.Value = 300
- IntValue97.Name = "LethalGrenades"
- IntValue97.Parent = Tool0
- IntValue97.Value = 15
- IntValue98.Name = "ClipSize"
- IntValue98.Parent = Tool0
- IntValue98.Value = 6
- IntValue99.Name = "Ammo"
- IntValue99.Parent = Tool0
- IntValue99.Value = 6
- Part100.Parent = Tool0
- Part100.Material = Enum.Material.Metal
- Part100.BrickColor = BrickColor.new("Black")
- Part100.Rotation = Vector3.new(0, 0, -180)
- Part100.Anchored = true
- Part100.FormFactor = Enum.FormFactor.Plate
- Part100.Size = Vector3.new(1, 0.400000006, 1)
- Part100.CFrame = CFrame.new(2.5, 0.373344988, 49.109993, -1, 0, 0, 0, -1, 0, 0, 0, 1)
- Part100.BottomSurface = Enum.SurfaceType.Smooth
- Part100.TopSurface = Enum.SurfaceType.Smooth
- Part100.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part100.Position = Vector3.new(2.5, 0.373344988, 49.109993)
- Part100.Orientation = Vector3.new(0, 0, 180)
- Part100.Color = Color3.new(0.105882, 0.164706, 0.207843)
- SpecialMesh101.Parent = Part100
- SpecialMesh101.Scale = Vector3.new(0.13333334, 1, 0.13333334)
- SpecialMesh101.MeshType = Enum.MeshType.Wedge
- SpecialMesh101.Scale = Vector3.new(0.13333334, 1, 0.13333334)
- ManualWeld102.Name = "Part-to-Handle Strong Joint"
- ManualWeld102.Parent = Part100
- ManualWeld102.C0 = CFrame.new(0.5, -0.200000003, 0.5, 1, 0, 0, 0, 0, -1, 0, 1, 0)
- ManualWeld102.C1 = CFrame.new(-0.5, -0.0866544843, 0.432993889, -1, 0, 4.10676591e-07, 4.10676591e-07, 7.13453232e-07, 1, -2.92998536e-13, 1, -7.13453232e-07)
- ManualWeld102.Part0 = Part100
- ManualWeld102.Part1 = Part12
- Part103.Parent = Tool0
- Part103.Material = Enum.Material.Metal
- Part103.BrickColor = BrickColor.new("Dark stone grey")
- Part103.Rotation = Vector3.new(0, 0, -180)
- Part103.Anchored = true
- Part103.FormFactor = Enum.FormFactor.Plate
- Part103.Size = Vector3.new(1, 0.400000006, 1)
- Part103.CFrame = CFrame.new(2.5, 0.573346019, 48.8766632, -1, 0, 0, 0, -1, 0, 0, 0, 1)
- Part103.BottomSurface = Enum.SurfaceType.Smooth
- Part103.TopSurface = Enum.SurfaceType.Smooth
- Part103.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part103.Position = Vector3.new(2.5, 0.573346019, 48.8766632)
- Part103.Orientation = Vector3.new(0, 0, 180)
- Part103.Color = Color3.new(0.388235, 0.372549, 0.384314)
- BlockMesh104.Parent = Part103
- BlockMesh104.Scale = Vector3.new(0.0666666701, 0.0666666701, 0.13333334)
- BlockMesh104.Scale = Vector3.new(0.0666666701, 0.0666666701, 0.13333334)
- Part105.Parent = Tool0
- Part105.Material = Enum.Material.Metal
- Part105.BrickColor = BrickColor.new("Black")
- Part105.Rotation = Vector3.new(-180, 0, 0)
- Part105.Anchored = true
- Part105.FormFactor = Enum.FormFactor.Plate
- Part105.Size = Vector3.new(1, 0.400000006, 1)
- Part105.CFrame = CFrame.new(2.5, 0.200011998, 49.3099976, 1, 0, 0, 0, -1, 0, 0, 0, -1)
- Part105.BottomSurface = Enum.SurfaceType.Smooth
- Part105.TopSurface = Enum.SurfaceType.Smooth
- Part105.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part105.Position = Vector3.new(2.5, 0.200011998, 49.3099976)
- Part105.Orientation = Vector3.new(0, 180, 180)
- Part105.Color = Color3.new(0.105882, 0.164706, 0.207843)
- SpecialMesh106.Parent = Part105
- SpecialMesh106.Scale = Vector3.new(0.13333334, 0.13333334, 0.266666681)
- SpecialMesh106.MeshType = Enum.MeshType.Wedge
- SpecialMesh106.Scale = Vector3.new(0.13333334, 0.13333334, 0.266666681)
- Part107.Parent = Tool0
- Part107.Material = Enum.Material.Metal
- Part107.BrickColor = BrickColor.new("Black")
- Part107.Rotation = Vector3.new(0, 0, -180)
- Part107.Anchored = true
- Part107.FormFactor = Enum.FormFactor.Plate
- Part107.Size = Vector3.new(1, 0.400000006, 1)
- Part107.CFrame = CFrame.new(2.5, 0.66001302, 49.1766624, -1, 0, 0, 0, -1, 0, 0, 0, 1)
- Part107.BottomSurface = Enum.SurfaceType.Smooth
- Part107.TopSurface = Enum.SurfaceType.Smooth
- Part107.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part107.Position = Vector3.new(2.5, 0.66001302, 49.1766624)
- Part107.Orientation = Vector3.new(0, 0, 180)
- Part107.Color = Color3.new(0.105882, 0.164706, 0.207843)
- BlockMesh108.Parent = Part107
- BlockMesh108.Scale = Vector3.new(0.13333334, 0.433333367, 0.266666681)
- BlockMesh108.Scale = Vector3.new(0.13333334, 0.433333367, 0.266666681)
- Part109.Parent = Tool0
- Part109.Material = Enum.Material.Metal
- Part109.BrickColor = BrickColor.new("Black")
- Part109.Anchored = true
- Part109.FormFactor = Enum.FormFactor.Plate
- Part109.Size = Vector3.new(1, 0.400000006, 1)
- Part109.CFrame = CFrame.new(2.5, 0.613345027, 50.5599976, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part109.BottomSurface = Enum.SurfaceType.Smooth
- Part109.TopSurface = Enum.SurfaceType.Smooth
- Part109.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part109.Position = Vector3.new(2.5, 0.613345027, 50.5599976)
- Part109.Color = Color3.new(0.105882, 0.164706, 0.207843)
- BlockMesh110.Parent = Part109
- BlockMesh110.Scale = Vector3.new(0.200000003, 0.666666687, 0.300000012)
- BlockMesh110.Scale = Vector3.new(0.200000003, 0.666666687, 0.300000012)
- Part111.Parent = Tool0
- Part111.Material = Enum.Material.Metal
- Part111.BrickColor = BrickColor.new("Dark stone grey")
- Part111.Rotation = Vector3.new(-180, 0, -180)
- Part111.Anchored = true
- Part111.FormFactor = Enum.FormFactor.Plate
- Part111.Size = Vector3.new(1, 0.400000006, 1)
- Part111.CFrame = CFrame.new(2.5, 0.606679022, 48.7933273, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part111.BottomSurface = Enum.SurfaceType.Smooth
- Part111.TopSurface = Enum.SurfaceType.Smooth
- Part111.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part111.Position = Vector3.new(2.5, 0.606679022, 48.7933273)
- Part111.Orientation = Vector3.new(0, 180, 0)
- Part111.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh112.Parent = Part111
- SpecialMesh112.Scale = Vector3.new(0.0666666701, 0.100000009, 0.100000001)
- SpecialMesh112.MeshType = Enum.MeshType.Wedge
- SpecialMesh112.Scale = Vector3.new(0.0666666701, 0.100000009, 0.100000001)
- ManualWeld113.Name = "Part-to-Shell Strong Joint"
- ManualWeld113.Parent = Part111
- ManualWeld113.C0 = CFrame.new(-0.5, -0.200000003, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- ManualWeld113.C1 = CFrame.new(0.300000966, 0.493340492, -0.5, 4.37113883e-08, -1, 4.37113883e-08, 0, -4.37113883e-08, -1, 1, 4.37113883e-08, -1.91068547e-15)
- ManualWeld113.Part0 = Part111
- ManualWeld113.Part1 = Part5
- Part114.Parent = Tool0
- Part114.Material = Enum.Material.Metal
- Part114.BrickColor = BrickColor.new("Dark stone grey")
- Part114.Rotation = Vector3.new(-180, 0, 0)
- Part114.Anchored = true
- Part114.FormFactor = Enum.FormFactor.Plate
- Part114.Size = Vector3.new(1, 0.400000006, 1)
- Part114.CFrame = CFrame.new(2.5, 0.573346019, 48.9933319, 1, 0, 0, 0, -1, 0, 0, 0, -1)
- Part114.BottomSurface = Enum.SurfaceType.Smooth
- Part114.TopSurface = Enum.SurfaceType.Smooth
- Part114.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part114.Position = Vector3.new(2.5, 0.573346019, 48.9933319)
- Part114.Orientation = Vector3.new(0, 180, 180)
- Part114.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh115.Parent = Part114
- SpecialMesh115.Scale = Vector3.new(0.0666666701, 0.0666666701, 0.100000001)
- SpecialMesh115.MeshType = Enum.MeshType.Wedge
- SpecialMesh115.Scale = Vector3.new(0.0666666701, 0.0666666701, 0.100000001)
- ManualWeld116.Name = "Part-to-Shell Strong Joint"
- ManualWeld116.Parent = Part114
- ManualWeld116.C0 = CFrame.new(-0.5, -0.200000003, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- ManualWeld116.C1 = CFrame.new(-0.066666007, 0.493331909, 0.50000006, -4.37113883e-08, 1, 4.37113883e-08, 0, 4.37113883e-08, -1, -1, -4.37113883e-08, -1.91068547e-15)
- ManualWeld116.Part0 = Part114
- ManualWeld116.Part1 = Part15
- Part117.Parent = Tool0
- Part117.Material = Enum.Material.Metal
- Part117.BrickColor = BrickColor.new("Dark stone grey")
- Part117.Rotation = Vector3.new(0, 0, -180)
- Part117.Anchored = true
- Part117.FormFactor = Enum.FormFactor.Plate
- Part117.Size = Vector3.new(1, 0.400000006, 1)
- Part117.CFrame = CFrame.new(2.5, 0.633346021, 48.5599976, -1, 0, 0, 0, -1, 0, 0, 0, 1)
- Part117.BottomSurface = Enum.SurfaceType.Smooth
- Part117.TopSurface = Enum.SurfaceType.Smooth
- Part117.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part117.Position = Vector3.new(2.5, 0.633346021, 48.5599976)
- Part117.Orientation = Vector3.new(0, 0, 180)
- Part117.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh118.Parent = Part117
- SpecialMesh118.Scale = Vector3.new(0.0666666701, 0.100000009, 0.0333333351)
- SpecialMesh118.MeshType = Enum.MeshType.Wedge
- SpecialMesh118.Scale = Vector3.new(0.0666666701, 0.100000009, 0.0333333351)
- ManualWeld119.Name = "Part-to-Handle Strong Joint"
- ManualWeld119.Parent = Part117
- ManualWeld119.C0 = CFrame.new(-0.5, -0.200000003, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- ManualWeld119.C1 = CFrame.new(0.5, 0.173345685, -0.117003441, -1, -4.10676591e-07, 0, 4.10676591e-07, -1, 7.13453232e-07, -2.92998536e-13, 7.13453232e-07, 1)
- ManualWeld119.Part0 = Part117
- ManualWeld119.Part1 = Part12
- Part120.Parent = Tool0
- Part120.Material = Enum.Material.Metal
- Part120.BrickColor = BrickColor.new("Dark stone grey")
- Part120.Rotation = Vector3.new(0, 0, -180)
- Part120.Anchored = true
- Part120.FormFactor = Enum.FormFactor.Plate
- Part120.Size = Vector3.new(1, 0.400000006, 1)
- Part120.CFrame = CFrame.new(2.5, 0.600012004, 48.7099991, -1, 0, 0, 0, -1, 0, 0, 0, 1)
- Part120.BottomSurface = Enum.SurfaceType.Smooth
- Part120.TopSurface = Enum.SurfaceType.Smooth
- Part120.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part120.Position = Vector3.new(2.5, 0.600012004, 48.7099991)
- Part120.Orientation = Vector3.new(0, 0, 180)
- Part120.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh121.Parent = Part120
- SpecialMesh121.Scale = Vector3.new(0.0666666701, 0.0666666701, 0.0666666701)
- SpecialMesh121.MeshType = Enum.MeshType.Wedge
- SpecialMesh121.Scale = Vector3.new(0.0666666701, 0.0666666701, 0.0666666701)
- Part122.Parent = Tool0
- Part122.Material = Enum.Material.Metal
- Part122.BrickColor = BrickColor.new("Dark stone grey")
- Part122.Rotation = Vector3.new(0, 0, -180)
- Part122.Anchored = true
- Part122.FormFactor = Enum.FormFactor.Plate
- Part122.Size = Vector3.new(1, 0.400000006, 1)
- Part122.CFrame = CFrame.new(2.5, 0.573346019, 48.7766647, -1, 0, 0, 0, -1, 0, 0, 0, 1)
- Part122.BottomSurface = Enum.SurfaceType.Smooth
- Part122.TopSurface = Enum.SurfaceType.Smooth
- Part122.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part122.Position = Vector3.new(2.5, 0.573346019, 48.7766647)
- Part122.Orientation = Vector3.new(0, 0, 180)
- Part122.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh123.Parent = Part122
- SpecialMesh123.Scale = Vector3.new(0.0666666701, 0.0666666701, 0.0666666701)
- SpecialMesh123.MeshType = Enum.MeshType.Wedge
- SpecialMesh123.Scale = Vector3.new(0.0666666701, 0.0666666701, 0.0666666701)
- Part124.Parent = Tool0
- Part124.Material = Enum.Material.Metal
- Part124.BrickColor = BrickColor.new("Black")
- Part124.Rotation = Vector3.new(-180, 0, -180)
- Part124.Anchored = true
- Part124.FormFactor = Enum.FormFactor.Plate
- Part124.Size = Vector3.new(1, 0.400000006, 1)
- Part124.CFrame = CFrame.new(2.5, 0.686679006, 50.159996, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part124.BottomSurface = Enum.SurfaceType.Smooth
- Part124.TopSurface = Enum.SurfaceType.Smooth
- Part124.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part124.Position = Vector3.new(2.5, 0.686679006, 50.159996)
- Part124.Orientation = Vector3.new(0, 180, 0)
- Part124.Color = Color3.new(0.105882, 0.164706, 0.207843)
- BlockMesh125.Parent = Part124
- BlockMesh125.Scale = Vector3.new(0.200000003, 0.300000012, 0.5)
- BlockMesh125.Scale = Vector3.new(0.200000003, 0.300000012, 0.5)
- Part126.Parent = Tool0
- Part126.Material = Enum.Material.Metal
- Part126.BrickColor = BrickColor.new("Black")
- Part126.Rotation = Vector3.new(0, 0, -180)
- Part126.Anchored = true
- Part126.FormFactor = Enum.FormFactor.Plate
- Part126.Size = Vector3.new(1, 0.400000006, 1)
- Part126.CFrame = CFrame.new(2.5, 0.400011986, 49.2433281, -1, 0, 0, 0, -1, 0, 0, 0, 1)
- Part126.BottomSurface = Enum.SurfaceType.Smooth
- Part126.TopSurface = Enum.SurfaceType.Smooth
- Part126.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part126.Position = Vector3.new(2.5, 0.400011986, 49.2433281)
- Part126.Orientation = Vector3.new(0, 0, 180)
- Part126.Color = Color3.new(0.105882, 0.164706, 0.207843)
- BlockMesh127.Parent = Part126
- BlockMesh127.Scale = Vector3.new(0.13333334, 0.866666734, 0.13333334)
- BlockMesh127.Scale = Vector3.new(0.13333334, 0.866666734, 0.13333334)
- Part128.Parent = Tool0
- Part128.Material = Enum.Material.Metal
- Part128.BrickColor = BrickColor.new("Black")
- Part128.Rotation = Vector3.new(-180, 0, -180)
- Part128.Anchored = true
- Part128.FormFactor = Enum.FormFactor.Plate
- Part128.Size = Vector3.new(1, 0.400000006, 1)
- Part128.CFrame = CFrame.new(2.5, 0.426678985, 49.3766632, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part128.BottomSurface = Enum.SurfaceType.Smooth
- Part128.TopSurface = Enum.SurfaceType.Smooth
- Part128.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part128.Position = Vector3.new(2.5, 0.426678985, 49.3766632)
- Part128.Orientation = Vector3.new(0, 180, 0)
- Part128.Color = Color3.new(0.105882, 0.164706, 0.207843)
- SpecialMesh129.Parent = Part128
- SpecialMesh129.Scale = Vector3.new(0.13333334, 1, 0.13333334)
- SpecialMesh129.MeshType = Enum.MeshType.Wedge
- SpecialMesh129.Scale = Vector3.new(0.13333334, 1, 0.13333334)
- Part130.Parent = Tool0
- Part130.Material = Enum.Material.Metal
- Part130.BrickColor = BrickColor.new("Dark stone grey")
- Part130.Anchored = true
- Part130.FormFactor = Enum.FormFactor.Plate
- Part130.Size = Vector3.new(1, 0.400000006, 1)
- Part130.CFrame = CFrame.new(2.5, 0.600012004, 48.9933319, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part130.BottomSurface = Enum.SurfaceType.Smooth
- Part130.TopSurface = Enum.SurfaceType.Smooth
- Part130.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part130.Position = Vector3.new(2.5, 0.600012004, 48.9933319)
- Part130.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh131.Parent = Part130
- SpecialMesh131.Scale = Vector3.new(0.0666666701, 0.0666666701, 0.100000001)
- SpecialMesh131.MeshType = Enum.MeshType.Wedge
- SpecialMesh131.Scale = Vector3.new(0.0666666701, 0.0666666701, 0.100000001)
- ManualWeld132.Name = "Part-to-Shell Strong Joint"
- ManualWeld132.Parent = Part130
- ManualWeld132.C0 = CFrame.new(0.5, -0.200000003, -0.5, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- ManualWeld132.C1 = CFrame.new(0.306667954, 0.493331909, -0.5, 4.37113883e-08, -1, 4.37113883e-08, 0, -4.37113883e-08, -1, 1, 4.37113883e-08, -1.91068547e-15)
- ManualWeld132.Part0 = Part130
- ManualWeld132.Part1 = Part15
- Part133.Parent = Tool0
- Part133.Material = Enum.Material.Metal
- Part133.BrickColor = BrickColor.new("Lime green")
- Part133.Rotation = Vector3.new(-180, 0, -180)
- Part133.Anchored = true
- Part133.FormFactor = Enum.FormFactor.Plate
- Part133.Size = Vector3.new(1, 0.400000006, 1)
- Part133.CFrame = CFrame.new(2.55000305, 1.16001296, 48.1933289, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part133.BottomSurface = Enum.SurfaceType.Smooth
- Part133.TopSurface = Enum.SurfaceType.Smooth
- Part133.Color = Color3.new(0, 1, 0)
- Part133.Position = Vector3.new(2.55000305, 1.16001296, 48.1933289)
- Part133.Orientation = Vector3.new(0, 180, 0)
- Part133.Color = Color3.new(0, 1, 0)
- SpecialMesh134.Parent = Part133
- SpecialMesh134.Scale = Vector3.new(0.0333333351, 0.200000018, 0.0333333351)
- SpecialMesh134.MeshType = Enum.MeshType.Wedge
- SpecialMesh134.Scale = Vector3.new(0.0333333351, 0.200000018, 0.0333333351)
- Part135.Parent = Tool0
- Part135.Material = Enum.Material.Metal
- Part135.BrickColor = BrickColor.new("Black")
- Part135.Rotation = Vector3.new(180, 90, 0)
- Part135.Anchored = true
- Part135.FormFactor = Enum.FormFactor.Plate
- Part135.Size = Vector3.new(1, 0.400000006, 1)
- Part135.CFrame = CFrame.new(2.38333106, 0.766678989, 47.409996, 0, 0, 1, 0, -1, 0, 1, 0, -0)
- Part135.BottomSurface = Enum.SurfaceType.Smooth
- Part135.TopSurface = Enum.SurfaceType.Smooth
- Part135.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part135.Position = Vector3.new(2.38333106, 0.766678989, 47.409996)
- Part135.Orientation = Vector3.new(0, 90, 180)
- Part135.Color = Color3.new(0.105882, 0.164706, 0.207843)
- SpecialMesh136.Parent = Part135
- SpecialMesh136.Scale = Vector3.new(0.666666687, 0.633333325, 0.0333333351)
- SpecialMesh136.MeshType = Enum.MeshType.Wedge
- SpecialMesh136.Scale = Vector3.new(0.666666687, 0.633333325, 0.0333333351)
- Part137.Parent = Tool0
- Part137.Material = Enum.Material.Metal
- Part137.BrickColor = BrickColor.new("Dark stone grey")
- Part137.Anchored = true
- Part137.FormFactor = Enum.FormFactor.Plate
- Part137.Size = Vector3.new(1, 0.400000006, 1)
- Part137.CFrame = CFrame.new(2.5, 1.14001095, 48.1433334, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part137.BottomSurface = Enum.SurfaceType.Smooth
- Part137.TopSurface = Enum.SurfaceType.Smooth
- Part137.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part137.Position = Vector3.new(2.5, 1.14001095, 48.1433334)
- Part137.Color = Color3.new(0.388235, 0.372549, 0.384314)
- BlockMesh138.Parent = Part137
- BlockMesh138.Scale = Vector3.new(0.0666666701, 0.0333333351, 0.0666666701)
- BlockMesh138.Scale = Vector3.new(0.0666666701, 0.0333333351, 0.0666666701)
- Part139.Parent = Tool0
- Part139.Material = Enum.Material.Metal
- Part139.BrickColor = BrickColor.new("Dark stone grey")
- Part139.Anchored = true
- Part139.FormFactor = Enum.FormFactor.Plate
- Part139.Size = Vector3.new(1, 0.400000006, 1)
- Part139.CFrame = CFrame.new(2.44999695, 1.16001296, 48.1433334, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part139.BottomSurface = Enum.SurfaceType.Smooth
- Part139.TopSurface = Enum.SurfaceType.Smooth
- Part139.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part139.Position = Vector3.new(2.44999695, 1.16001296, 48.1433334)
- Part139.Color = Color3.new(0.388235, 0.372549, 0.384314)
- BlockMesh140.Parent = Part139
- BlockMesh140.Scale = Vector3.new(0.0333333351, 0.200000018, 0.0666666701)
- BlockMesh140.Scale = Vector3.new(0.0333333351, 0.200000018, 0.0666666701)
- Part141.Parent = Tool0
- Part141.Material = Enum.Material.Metal
- Part141.BrickColor = BrickColor.new("Black")
- Part141.Anchored = true
- Part141.FormFactor = Enum.FormFactor.Plate
- Part141.Size = Vector3.new(1, 0.400000006, 1)
- Part141.CFrame = CFrame.new(2.5, 0.833347976, 50.1766624, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part141.BottomSurface = Enum.SurfaceType.Smooth
- Part141.TopSurface = Enum.SurfaceType.Smooth
- Part141.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part141.Position = Vector3.new(2.5, 0.833347976, 50.1766624)
- Part141.Color = Color3.new(0.105882, 0.164706, 0.207843)
- BlockMesh142.Parent = Part141
- BlockMesh142.Scale = Vector3.new(0.200000003, 0.433333367, 1.06666672)
- BlockMesh142.Scale = Vector3.new(0.200000003, 0.433333367, 1.06666672)
- Part143.Parent = Tool0
- Part143.Material = Enum.Material.Metal
- Part143.BrickColor = BrickColor.new("Lime green")
- Part143.Rotation = Vector3.new(-180, 0, -180)
- Part143.Anchored = true
- Part143.FormFactor = Enum.FormFactor.Plate
- Part143.Size = Vector3.new(1, 0.400000006, 1)
- Part143.CFrame = CFrame.new(2.44999695, 1.16001296, 48.1933289, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part143.BottomSurface = Enum.SurfaceType.Smooth
- Part143.TopSurface = Enum.SurfaceType.Smooth
- Part143.Color = Color3.new(0, 1, 0)
- Part143.Position = Vector3.new(2.44999695, 1.16001296, 48.1933289)
- Part143.Orientation = Vector3.new(0, 180, 0)
- Part143.Color = Color3.new(0, 1, 0)
- SpecialMesh144.Parent = Part143
- SpecialMesh144.Scale = Vector3.new(0.0333333351, 0.200000018, 0.0333333351)
- SpecialMesh144.MeshType = Enum.MeshType.Wedge
- SpecialMesh144.Scale = Vector3.new(0.0333333351, 0.200000018, 0.0333333351)
- Part145.Parent = Tool0
- Part145.Material = Enum.Material.Metal
- Part145.BrickColor = BrickColor.new("Dark stone grey")
- Part145.Rotation = Vector3.new(0, 0, -180)
- Part145.Anchored = true
- Part145.FormFactor = Enum.FormFactor.Plate
- Part145.Size = Vector3.new(1, 0.400000006, 1)
- Part145.CFrame = CFrame.new(2.5, 0.680011988, 48.659996, -1, 0, 0, 0, -1, 0, 0, 0, 1)
- Part145.BottomSurface = Enum.SurfaceType.Smooth
- Part145.TopSurface = Enum.SurfaceType.Smooth
- Part145.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part145.Position = Vector3.new(2.5, 0.680011988, 48.659996)
- Part145.Orientation = Vector3.new(0, 0, 180)
- Part145.Color = Color3.new(0.388235, 0.372549, 0.384314)
- BlockMesh146.Parent = Part145
- BlockMesh146.Scale = Vector3.new(0.0666666701, 0.333333343, 0.166666672)
- BlockMesh146.Scale = Vector3.new(0.0666666701, 0.333333343, 0.166666672)
- Part147.Parent = Tool0
- Part147.Material = Enum.Material.Metal
- Part147.BrickColor = BrickColor.new("Dark stone grey")
- Part147.Anchored = true
- Part147.FormFactor = Enum.FormFactor.Plate
- Part147.Size = Vector3.new(1, 0.400000006, 1)
- Part147.CFrame = CFrame.new(2.55000305, 1.16001296, 48.1433334, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part147.BottomSurface = Enum.SurfaceType.Smooth
- Part147.TopSurface = Enum.SurfaceType.Smooth
- Part147.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part147.Position = Vector3.new(2.55000305, 1.16001296, 48.1433334)
- Part147.Color = Color3.new(0.388235, 0.372549, 0.384314)
- BlockMesh148.Parent = Part147
- BlockMesh148.Scale = Vector3.new(0.0333333351, 0.200000018, 0.0666666701)
- BlockMesh148.Scale = Vector3.new(0.0333333351, 0.200000018, 0.0666666701)
- Part149.Parent = Tool0
- Part149.Material = Enum.Material.Metal
- Part149.BrickColor = BrickColor.new("Black")
- Part149.Rotation = Vector3.new(-180, -90, 0)
- Part149.Anchored = true
- Part149.FormFactor = Enum.FormFactor.Plate
- Part149.Size = Vector3.new(1, 0.400000006, 1)
- Part149.CFrame = CFrame.new(2.61666894, 0.766678989, 47.409996, 0, 0, -1, 0, -1, -0, -1, 0, -0)
- Part149.BottomSurface = Enum.SurfaceType.Smooth
- Part149.TopSurface = Enum.SurfaceType.Smooth
- Part149.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part149.Position = Vector3.new(2.61666894, 0.766678989, 47.409996)
- Part149.Orientation = Vector3.new(0, -90, 180)
- Part149.Color = Color3.new(0.105882, 0.164706, 0.207843)
- SpecialMesh150.Parent = Part149
- SpecialMesh150.Scale = Vector3.new(0.666666687, 0.633333325, 0.0333333351)
- SpecialMesh150.MeshType = Enum.MeshType.Wedge
- SpecialMesh150.Scale = Vector3.new(0.666666687, 0.633333325, 0.0333333351)
- Part151.Parent = Tool0
- Part151.Material = Enum.Material.Metal
- Part151.Rotation = Vector3.new(-90, 0, 0)
- Part151.Anchored = true
- Part151.FormFactor = Enum.FormFactor.Plate
- Part151.Size = Vector3.new(1, 0.800000012, 1)
- Part151.CFrame = CFrame.new(2.5, 0.740013003, 46.6900024, 1, 0, -0, 0, 0, 1, 0, -1, 0)
- Part151.BottomSurface = Enum.SurfaceType.Smooth
- Part151.TopSurface = Enum.SurfaceType.Smooth
- Part151.Position = Vector3.new(2.5, 0.740013003, 46.6900024)
- Part151.Orientation = Vector3.new(-90, 0, 0)
- CylinderMesh152.Parent = Part151
- CylinderMesh152.Scale = Vector3.new(0.166666672, 0.883333385, 0.13333334)
- CylinderMesh152.Scale = Vector3.new(0.166666672, 0.883333385, 0.13333334)
- Part153.Parent = Tool0
- Part153.Material = Enum.Material.Metal
- Part153.BrickColor = BrickColor.new("Dark stone grey")
- Part153.Rotation = Vector3.new(0, 0, -180)
- Part153.Anchored = true
- Part153.FormFactor = Enum.FormFactor.Plate
- Part153.Size = Vector3.new(1, 0.400000006, 1)
- Part153.CFrame = CFrame.new(2.5, 0.700012028, 48.5599976, -1, 0, 0, 0, -1, 0, 0, 0, 1)
- Part153.BottomSurface = Enum.SurfaceType.Smooth
- Part153.TopSurface = Enum.SurfaceType.Smooth
- Part153.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part153.Position = Vector3.new(2.5, 0.700012028, 48.5599976)
- Part153.Orientation = Vector3.new(0, 0, 180)
- Part153.Color = Color3.new(0.388235, 0.372549, 0.384314)
- BlockMesh154.Parent = Part153
- BlockMesh154.Scale = Vector3.new(0.0666666701, 0.233333334, 0.0333333351)
- BlockMesh154.Scale = Vector3.new(0.0666666701, 0.233333334, 0.0333333351)
- ManualWeld155.Name = "Part-to-Handle Strong Joint"
- ManualWeld155.Parent = Part153
- ManualWeld155.C0 = CFrame.new(-0.5, -0.200000003, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- ManualWeld155.C1 = CFrame.new(0.500000238, 0.240011632, -0.117003441, -1, -4.10676591e-07, 0, 4.10676591e-07, -1, 7.13453232e-07, -2.92998536e-13, 7.13453232e-07, 1)
- ManualWeld155.Part0 = Part153
- ManualWeld155.Part1 = Part12
- Part156.Parent = Tool0
- Part156.Material = Enum.Material.Metal
- Part156.BrickColor = BrickColor.new("Dark stone grey")
- Part156.Anchored = true
- Part156.FormFactor = Enum.FormFactor.Plate
- Part156.Size = Vector3.new(1, 0.400000006, 2)
- Part156.CFrame = CFrame.new(2.5, 1.12667894, 47.409996, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part156.BottomSurface = Enum.SurfaceType.Smooth
- Part156.TopSurface = Enum.SurfaceType.Smooth
- Part156.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part156.Position = Vector3.new(2.5, 1.12667894, 47.409996)
- Part156.Color = Color3.new(0.388235, 0.372549, 0.384314)
- BlockMesh157.Parent = Part156
- BlockMesh157.Scale = Vector3.new(0.0666666701, 0.0333333351, 0.766666651)
- BlockMesh157.Scale = Vector3.new(0.0666666701, 0.0333333351, 0.766666651)
- Part158.Parent = Tool0
- Part158.Material = Enum.Material.Metal
- Part158.BrickColor = BrickColor.new("Black")
- Part158.Rotation = Vector3.new(-180, 0, 0)
- Part158.Anchored = true
- Part158.FormFactor = Enum.FormFactor.Plate
- Part158.Size = Vector3.new(1, 0.400000006, 1)
- Part158.CFrame = CFrame.new(2.5, 0.686679006, 49.3599968, 1, 0, 0, 0, -1, 0, 0, 0, -1)
- Part158.BottomSurface = Enum.SurfaceType.Smooth
- Part158.TopSurface = Enum.SurfaceType.Smooth
- Part158.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part158.Position = Vector3.new(2.5, 0.686679006, 49.3599968)
- Part158.Orientation = Vector3.new(0, 180, 180)
- Part158.Color = Color3.new(0.105882, 0.164706, 0.207843)
- SpecialMesh159.Parent = Part158
- SpecialMesh159.Scale = Vector3.new(0.13333334, 0.300000012, 0.100000001)
- SpecialMesh159.MeshType = Enum.MeshType.Wedge
- SpecialMesh159.Scale = Vector3.new(0.13333334, 0.300000012, 0.100000001)
- Part160.Parent = Tool0
- Part160.Material = Enum.Material.Metal
- Part160.Rotation = Vector3.new(-90, 0, -180)
- Part160.Anchored = true
- Part160.FormFactor = Enum.FormFactor.Plate
- Part160.Size = Vector3.new(1, 1.60000002, 1)
- Part160.CFrame = CFrame.new(2.5, 1.02001297, 47.4300003, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Part160.BottomSurface = Enum.SurfaceType.Smooth
- Part160.TopSurface = Enum.SurfaceType.Smooth
- Part160.Position = Vector3.new(2.5, 1.02001297, 47.4300003)
- Part160.Orientation = Vector3.new(-90, -180, 0)
- CylinderMesh161.Parent = Part160
- CylinderMesh161.Scale = Vector3.new(0.200000003, 1.10833335, 0.200000003)
- CylinderMesh161.Scale = Vector3.new(0.200000003, 1.10833335, 0.200000003)
- Part162.Parent = Tool0
- Part162.Material = Enum.Material.Metal
- Part162.BrickColor = BrickColor.new("Dark stone grey")
- Part162.Rotation = Vector3.new(-180, 0, -180)
- Part162.Anchored = true
- Part162.FormFactor = Enum.FormFactor.Plate
- Part162.Size = Vector3.new(1, 0.400000006, 1)
- Part162.CFrame = CFrame.new(2.5, 1.12667894, 48.2433319, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part162.BottomSurface = Enum.SurfaceType.Smooth
- Part162.TopSurface = Enum.SurfaceType.Smooth
- Part162.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part162.Position = Vector3.new(2.5, 1.12667894, 48.2433319)
- Part162.Orientation = Vector3.new(0, 180, 0)
- Part162.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh163.Parent = Part162
- SpecialMesh163.Scale = Vector3.new(0.0666666701, 0.0333333351, 0.13333334)
- SpecialMesh163.MeshType = Enum.MeshType.Wedge
- SpecialMesh163.Scale = Vector3.new(0.0666666701, 0.0333333351, 0.13333334)
- Part164.Parent = Tool0
- Part164.Material = Enum.Material.Metal
- Part164.BrickColor = BrickColor.new("Lime green")
- Part164.Rotation = Vector3.new(-180, 0, -180)
- Part164.Anchored = true
- Part164.FormFactor = Enum.FormFactor.Plate
- Part164.Size = Vector3.new(1, 0.400000006, 1)
- Part164.CFrame = CFrame.new(2.5, 1.15334594, 46.6266632, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part164.BottomSurface = Enum.SurfaceType.Smooth
- Part164.TopSurface = Enum.SurfaceType.Smooth
- Part164.Color = Color3.new(0, 1, 0)
- Part164.Position = Vector3.new(2.5, 1.15334594, 46.6266632)
- Part164.Orientation = Vector3.new(0, 180, 0)
- Part164.Color = Color3.new(0, 1, 0)
- SpecialMesh165.Parent = Part164
- SpecialMesh165.Scale = Vector3.new(0.0666666701, 0.166666672, 0.0333333351)
- SpecialMesh165.MeshType = Enum.MeshType.Wedge
- SpecialMesh165.Scale = Vector3.new(0.0666666701, 0.166666672, 0.0333333351)
- Part166.Parent = Tool0
- Part166.Material = Enum.Material.Metal
- Part166.BrickColor = BrickColor.new("Dark stone grey")
- Part166.Anchored = true
- Part166.FormFactor = Enum.FormFactor.Plate
- Part166.Size = Vector3.new(1, 0.400000006, 1)
- Part166.CFrame = CFrame.new(2.5, 1.05334496, 46.5099945, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part166.BottomSurface = Enum.SurfaceType.Smooth
- Part166.TopSurface = Enum.SurfaceType.Smooth
- Part166.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part166.Position = Vector3.new(2.5, 1.05334496, 46.5099945)
- Part166.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh167.Parent = Part166
- SpecialMesh167.Scale = Vector3.new(0.0666666701, 0.666666687, 0.0666666701)
- SpecialMesh167.MeshType = Enum.MeshType.Wedge
- SpecialMesh167.Scale = Vector3.new(0.0666666701, 0.666666687, 0.0666666701)
- Part168.Parent = Tool0
- Part168.Material = Enum.Material.Metal
- Part168.Rotation = Vector3.new(-90, 0, -180)
- Part168.Anchored = true
- Part168.FormFactor = Enum.FormFactor.Plate
- Part168.Size = Vector3.new(1, 1.20000005, 1)
- Part168.CFrame = CFrame.new(2.5, 0.870019972, 46.4633331, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Part168.BottomSurface = Enum.SurfaceType.Smooth
- Part168.TopSurface = Enum.SurfaceType.Smooth
- Part168.Position = Vector3.new(2.5, 0.870019972, 46.4633331)
- Part168.Orientation = Vector3.new(-90, -180, 0)
- CylinderMesh169.Parent = Part168
- CylinderMesh169.Scale = Vector3.new(0.100000001, 0.966666579, 0.100000001)
- CylinderMesh169.Scale = Vector3.new(0.100000001, 0.966666579, 0.100000001)
- Part170.Parent = Tool0
- Part170.Material = Enum.Material.Metal
- Part170.BrickColor = BrickColor.new("Dark stone grey")
- Part170.Rotation = Vector3.new(0, 0, -180)
- Part170.Anchored = true
- Part170.FormFactor = Enum.FormFactor.Plate
- Part170.Size = Vector3.new(1, 0.400000006, 2)
- Part170.CFrame = CFrame.new(2.5, 0.833347976, 48.8266602, -1, 0, 0, 0, -1, 0, 0, 0, 1)
- Part170.BottomSurface = Enum.SurfaceType.Smooth
- Part170.TopSurface = Enum.SurfaceType.Smooth
- Part170.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part170.Position = Vector3.new(2.5, 0.833347976, 48.8266602)
- Part170.Orientation = Vector3.new(0, 0, 180)
- Part170.Color = Color3.new(0.388235, 0.372549, 0.384314)
- BlockMesh171.Parent = Part170
- BlockMesh171.Scale = Vector3.new(0.13333334, 0.433333367, 0.816666663)
- BlockMesh171.Scale = Vector3.new(0.13333334, 0.433333367, 0.816666663)
- Part172.Parent = Tool0
- Part172.Material = Enum.Material.Metal
- Part172.BrickColor = BrickColor.new("Dark stone grey")
- Part172.Anchored = true
- Part172.FormFactor = Enum.FormFactor.Plate
- Part172.Size = Vector3.new(1, 0.400000006, 1)
- Part172.CFrame = CFrame.new(2.5, 0.780013978, 47.5266647, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part172.BottomSurface = Enum.SurfaceType.Smooth
- Part172.TopSurface = Enum.SurfaceType.Smooth
- Part172.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part172.Position = Vector3.new(2.5, 0.780013978, 47.5266647)
- Part172.Color = Color3.new(0.388235, 0.372549, 0.384314)
- BlockMesh173.Parent = Part172
- BlockMesh173.Scale = Vector3.new(0.200000003, 0.700000048, 0.966666639)
- BlockMesh173.Scale = Vector3.new(0.200000003, 0.700000048, 0.966666639)
- Part174.Parent = Tool0
- Part174.Material = Enum.Material.Metal
- Part174.BrickColor = BrickColor.new("Black")
- Part174.Anchored = true
- Part174.FormFactor = Enum.FormFactor.Plate
- Part174.Size = Vector3.new(1, 0.400000006, 2)
- Part174.CFrame = CFrame.new(2.5, 1.00668001, 49.8766632, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part174.BottomSurface = Enum.SurfaceType.Smooth
- Part174.TopSurface = Enum.SurfaceType.Smooth
- Part174.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part174.Position = Vector3.new(2.5, 1.00668001, 49.8766632)
- Part174.Color = Color3.new(0.105882, 0.164706, 0.207843)
- BlockMesh175.Parent = Part174
- BlockMesh175.Scale = Vector3.new(0.200000003, 0.433333367, 0.833333313)
- BlockMesh175.Scale = Vector3.new(0.200000003, 0.433333367, 0.833333313)
- Part176.Parent = Tool0
- Part176.Material = Enum.Material.Metal
- Part176.BrickColor = BrickColor.new("Dark stone grey")
- Part176.Rotation = Vector3.new(90, 0, 0)
- Part176.Anchored = true
- Part176.FormFactor = Enum.FormFactor.Plate
- Part176.Size = Vector3.new(1, 0.800000012, 1)
- Part176.CFrame = CFrame.new(2.5, 1.00335801, 48.6766663, 1, 0, 0, 0, 0, -1, 0, 1, 0)
- Part176.BottomSurface = Enum.SurfaceType.Smooth
- Part176.TopSurface = Enum.SurfaceType.Smooth
- Part176.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part176.Position = Vector3.new(2.5, 1.00335801, 48.6766663)
- Part176.Orientation = Vector3.new(90, 0, 0)
- Part176.Color = Color3.new(0.388235, 0.372549, 0.384314)
- CylinderMesh177.Parent = Part176
- CylinderMesh177.Scale = Vector3.new(0.200000003, 0.900000036, 0.200000003)
- CylinderMesh177.Scale = Vector3.new(0.200000003, 0.900000036, 0.200000003)
- ManualWeld178.Name = "Part-to-Handle Strong Joint"
- ManualWeld178.Parent = Part176
- ManualWeld178.C0 = CFrame.new(-0.5, 0.400000006, 0.5, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- ManualWeld178.C1 = CFrame.new(-0.5, -0.156641901, -0.100334167, -1, -4.10676591e-07, 0, 4.10676591e-07, -1, 7.13453232e-07, -2.92998536e-13, 7.13453232e-07, 1)
- ManualWeld178.Part0 = Part176
- ManualWeld178.Part1 = Part12
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement