Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------
- ------School Shooting v3---------------------------------------------
- ---------------------------------------------------------------------
- ---Credit to 1ndrew for the Gun Script! Made By RobloxPlayerBeta---
- ---------------------------------------------------------------------
- plr = game.Players.LocalPlayer
- char = game.Players.LocalPlayer.Character
- head =char.Head
- hum = char.Humanoid
- torso = char.Torso
- ---------------------------------------------------------------------
- ---Audio [Credit to the owner of Backpack Music Boombox :D!----------
- ---------------------------------------------------------------------
- o1 = Instance.new("Model")
- o1.Name = "Vest"
- o2 = Instance.new("Part")
- o2.Name = "Middle"
- o2.Parent = o1
- o2.BrickColor = BrickColor.new("Brick yellow")
- o2.Transparency = 1
- o2.Position = Vector3.new(0.139906004, 1.05800402, -11.1099901)
- o2.Anchored = true
- o2.CFrame = CFrame.new(0.139906004, 1.05800402, -11.1099901, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o2.CanCollide = false
- o2.FormFactor = Enum.FormFactor.Symmetric
- o2.Size = Vector3.new(2, 2, 1)
- o2.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- o2.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- o2.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- o2.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- o2.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- o2.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- o2.Color = Color3.new(0.843137, 0.772549, 0.603922)
- o3 = Instance.new("Part")
- o3.Name = "Pack"
- o3.Parent = o1
- o3.BrickColor = BrickColor.new("Dark stone grey")
- o3.Position = Vector3.new(0.139907002, 1.07000601, -10.3049936)
- o3.Rotation = Vector3.new(-180, 0, -180)
- o3.Anchored = true
- o3.CFrame = CFrame.new(0.139907002, 1.07000601, -10.3049936, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- o3.CanCollide = false
- o3.FormFactor = Enum.FormFactor.Custom
- o3.Size = Vector3.new(1.65999985, 1.80000019, 0.630000472)
- o3.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- o3.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- o3.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- o3.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- o3.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- o3.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- o3.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o4 = Instance.new("Part")
- o4.Name = "Strap"
- o4.Parent = o1
- o4.BrickColor = BrickColor.new("Black")
- o4.Position = Vector3.new(0.66991502, 1.05500698, -11.1149797)
- o4.Anchored = true
- o4.CFrame = CFrame.new(0.66991502, 1.05500698, -11.1149797, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o4.CanCollide = false
- o4.FormFactor = Enum.FormFactor.Custom
- o4.Size = Vector3.new(0.259999752, 2.11000037, 1.15000045)
- o4.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- o4.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- o4.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- o4.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- o4.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- o4.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- o4.Color = Color3.new(0.105882, 0.164706, 0.207843)
- o5 = Instance.new("Part")
- o5.Name = "Flap"
- o5.Parent = o1
- o5.BrickColor = BrickColor.new("Black")
- o5.Position = Vector3.new(0.139905006, 1.85000098, -10.2900219)
- o5.Anchored = true
- o5.CFrame = CFrame.new(0.139905006, 1.85000098, -10.2900219, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o5.CanCollide = false
- o5.FormFactor = Enum.FormFactor.Custom
- o5.Size = Vector3.new(1.71999979, 0.400000006, 0.639999866)
- o5.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- o5.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- o5.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- o5.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- o5.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- o5.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- o5.Color = Color3.new(0.105882, 0.164706, 0.207843)
- o6 = Instance.new("Part")
- o6.Name = "Pocket"
- o6.Parent = o1
- o6.BrickColor = BrickColor.new("Black")
- o6.Position = Vector3.new(0.149883002, 0.860005975, -10.0399857)
- o6.Rotation = Vector3.new(-0, 0, -90)
- o6.Anchored = true
- o6.CFrame = CFrame.new(0.149883002, 0.860005975, -10.0399857, 0, 1, 0, -1, 0, 0, 0, 0, 1)
- o6.CanCollide = false
- o6.FormFactor = Enum.FormFactor.Custom
- o6.Size = Vector3.new(0.600000024, 0.800000131, 0.200000003)
- o6.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- o6.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- o6.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- o6.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- o6.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- o6.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- o6.Color = Color3.new(0.105882, 0.164706, 0.207843)
- o7 = Instance.new("Part")
- o7.Name = "Pocket"
- o7.Parent = o1
- o7.BrickColor = BrickColor.new("Black")
- o7.Position = Vector3.new(0.139600992, 1.10000801, -10.3099718)
- o7.Rotation = Vector3.new(-90, 90, 0)
- o7.Anchored = true
- o7.CFrame = CFrame.new(0.139600992, 1.10000801, -10.3099718, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- o7.CanCollide = false
- o7.FormFactor = Enum.FormFactor.Custom
- o7.Size = Vector3.new(0.600000024, 0.400000155, 1.70000005)
- o7.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- o7.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- o7.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- o7.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- o7.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- o7.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- o7.Color = Color3.new(0.105882, 0.164706, 0.207843)
- o8 = Instance.new("Part")
- o8.Name = "Strap"
- o8.Parent = o1
- o8.BrickColor = BrickColor.new("Black")
- o8.Position = Vector3.new(-0.37014699, 1.05500698, -11.1149921)
- o8.Anchored = true
- o8.CFrame = CFrame.new(-0.37014699, 1.05500698, -11.1149921, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o8.CanCollide = false
- o8.FormFactor = Enum.FormFactor.Custom
- o8.Size = Vector3.new(0.259999752, 2.11000037, 1.15000045)
- o8.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- o8.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- o8.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- o8.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- o8.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- o8.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- o8.Color = Color3.new(0.105882, 0.164706, 0.207843)
- o9 = Instance.new("Part")
- o9.Parent = o1
- o9.BrickColor = BrickColor.new("Really black")
- o9.Reflectance = 0.10000000149012
- o9.Position = Vector3.new(0.173590899, 4.00173569, -9.98207664)
- o9.Rotation = Vector3.new(2.9181666e-009, -3.48279983e-008, -8.55249798e-019)
- o9.Anchored = true
- o9.CFrame = CFrame.new(0.173590899, 4.00173569, -9.98207664, 0.999998331, 1.49269007e-020, -6.07863204e-010, 1.49269007e-020, 1, -5.09317831e-011, -6.07863204e-010, -5.09317831e-011, 1.00000334)
- o9.FormFactor = Enum.FormFactor.Plate
- o9.Size = Vector3.new(2, 4.80000019, 2)
- o9.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- o9.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- o9.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- o9.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- o9.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- o9.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- o9.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- o10 = Instance.new("SpecialMesh")
- o10.Parent = o9
- o10.Scale = Vector3.new(0.600000024, 1, 0.600000024)
- o10.MeshType = Enum.MeshType.Brick
- o11 = Instance.new("Part")
- o11.Parent = o1
- o11.BrickColor = BrickColor.new("Mid gray")
- o11.Reflectance = 0.20000000298023
- o11.Position = Vector3.new(0.173592806, 4.10173273, -11.1821489)
- o11.Rotation = Vector3.new(-180, 89.8953247, -90)
- o11.Anchored = true
- o11.CFrame = CFrame.new(0.173592806, 4.10173273, -11.1821489, -1.49269007e-020, 6.07863204e-010, 0.999998331, -1, 5.09317831e-011, 1.49269007e-020, 5.09317831e-011, -1.00000334, -6.07863204e-010)
- o11.FormFactor = Enum.FormFactor.Plate
- o11.Size = Vector3.new(1, 0.400000006, 2)
- o11.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- o11.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- o11.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- o11.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- o11.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- o11.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- o11.Color = Color3.new(0.803922, 0.803922, 0.803922)
- o12 = Instance.new("CylinderMesh")
- o12.Parent = o11
- o12.Offset = Vector3.new(0, -0.600000024, 0)
- o12.Scale = Vector3.new(0.5, 0.100000001, 0.5)
- o13 = Instance.new("Part")
- o13.Parent = o1
- o13.BrickColor = BrickColor.new("Mid gray")
- o13.Reflectance = 0.20000000298023
- o13.Position = Vector3.new(0.173592806, 5.60169125, -11.1821489)
- o13.Rotation = Vector3.new(1.40697509e-009, -89.8953247, -90)
- o13.Anchored = true
- o13.CFrame = CFrame.new(0.173592806, 5.60169125, -11.1821489, 1.49269007e-020, 6.07863204e-010, -0.999998331, 1, 5.09317831e-011, -1.49269007e-020, -5.09317831e-011, -1.00000334, 6.07863204e-010)
- o13.FormFactor = Enum.FormFactor.Plate
- o13.Size = Vector3.new(2, 0.400000006, 2)
- o13.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- o13.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- o13.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- o13.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- o13.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- o13.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- o13.Color = Color3.new(0.803922, 0.803922, 0.803922)
- o14 = Instance.new("CylinderMesh")
- o14.Parent = o13
- o14.Offset = Vector3.new(0, -0.600000024, 0)
- o14.Scale = Vector3.new(0.5, 0.100000001, 0.5)
- o15 = Instance.new("Part")
- o15.Parent = o1
- o15.BrickColor = BrickColor.new("Mid gray")
- o15.Reflectance = 0.20000000298023
- o15.Position = Vector3.new(0.173592806, 2.60173273, -11.1821489)
- o15.Rotation = Vector3.new(-180, 89.8953247, -90)
- o15.Anchored = true
- o15.CFrame = CFrame.new(0.173592806, 2.60173273, -11.1821489, -1.49269007e-020, 6.07863204e-010, 0.999998331, -1, 5.09317831e-011, 1.49269007e-020, 5.09317831e-011, -1.00000334, -6.07863204e-010)
- o15.FormFactor = Enum.FormFactor.Plate
- o15.Size = Vector3.new(2, 0.400000006, 2)
- o15.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- o15.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- o15.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- o15.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- o15.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- o15.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- o15.Color = Color3.new(0.803922, 0.803922, 0.803922)
- o16 = Instance.new("CylinderMesh")
- o16.Parent = o15
- o16.Offset = Vector3.new(0, -0.600000024, 0)
- o16.Scale = Vector3.new(0.5, 0.100000001, 0.5)
- myears = Instance.new('Sound')
- myears.Parent = game.Players.LocalPlayer.Character.Head
- myears.Looped = true
- myears.Name = "Ruski"
- myears.Playing = true
- myears.SoundId = "rbxassetid://1362210403"
- myears.Volume = .5
- myears.Pitch = 1
- myears.TimePosition = 0
- local g = o1:clone()
- g.Parent = game.Players.LocalPlayer.Character
- local C = g:GetChildren()
- for i=1, #C do
- if C[i].className == "Part" then
- local W = Instance.new("Weld")
- W.Part0 = g.Middle
- W.Part1 = C[i]
- local CJ = CFrame.new(g.Middle.Position)
- local C0 = g.Middle.CFrame:inverse()*CJ
- local C1 = C[i].CFrame:inverse()*CJ
- W.C0 = C0
- W.C1 = C1
- W.Parent = g.Middle
- end
- local Y = Instance.new("Weld")
- Y.Part0 = game.Players.LocalPlayer.Character.Torso
- Y.Part1 = g.Middle
- Y.C0 = CFrame.new(0, 0, 0)
- Y.Parent = Y.Part0
- end
- local h = g:GetChildren()
- for i = 1, # h do
- h[i].Anchored = false
- h[i].CanCollide = false
- end
- ---------------------------------------------------------------------
- ---Gun Script----------------------------------------------------------
- ---------------------------------------------------------------------
- --Made by 1ndrew csgo deagle
- 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")
- IntValue1 = Instance.new("IntValue")
- IntValue2 = Instance.new("IntValue")
- Script3 = Instance.new("Script")
- ObjectValue4 = Instance.new("ObjectValue")
- RemoteFunction5 = Instance.new("RemoteFunction")
- RemoteFunction6 = Instance.new("RemoteFunction")
- RemoteFunction7 = Instance.new("RemoteFunction")
- RemoteEvent8 = Instance.new("RemoteEvent")
- RemoteFunction9 = Instance.new("RemoteFunction")
- RemoteFunction10 = Instance.new("RemoteFunction")
- RemoteFunction11 = Instance.new("RemoteFunction")
- LocalScript12 = Instance.new("LocalScript")
- IntValue13 = Instance.new("IntValue")
- RemoteEvent14 = Instance.new("RemoteEvent")
- RemoteEvent15 = Instance.new("RemoteEvent")
- RemoteEvent16 = Instance.new("RemoteEvent")
- RemoteEvent17 = Instance.new("RemoteEvent")
- NumberValue18 = Instance.new("NumberValue")
- Part19 = Instance.new("Part")
- ParticleEmitter20 = Instance.new("ParticleEmitter")
- ParticleEmitter21 = Instance.new("ParticleEmitter")
- PointLight22 = Instance.new("PointLight")
- Part23 = Instance.new("Part")
- BlockMesh24 = Instance.new("BlockMesh")
- Sound25 = Instance.new("Sound")
- Sound26 = Instance.new("Sound")
- Sound27 = Instance.new("Sound")
- Part28 = Instance.new("Part")
- BlockMesh29 = Instance.new("BlockMesh")
- LocalScript30 = Instance.new("LocalScript")
- IntValue31 = Instance.new("IntValue")
- Folder32 = Instance.new("Folder")
- ScreenGui33 = Instance.new("ScreenGui")
- Frame34 = Instance.new("Frame")
- Frame35 = Instance.new("Frame")
- TextLabel36 = Instance.new("TextLabel")
- TextLabel37 = Instance.new("TextLabel")
- TextLabel38 = Instance.new("TextLabel")
- Frame39 = Instance.new("Frame")
- TextLabel40 = Instance.new("TextLabel")
- TextLabel41 = Instance.new("TextLabel")
- Frame42 = Instance.new("Frame")
- Frame43 = Instance.new("Frame")
- ImageLabel44 = Instance.new("ImageLabel")
- TextLabel45 = Instance.new("TextLabel")
- TextLabel46 = Instance.new("TextLabel")
- Frame47 = Instance.new("Frame")
- ImageLabel48 = Instance.new("ImageLabel")
- TextLabel49 = Instance.new("TextLabel")
- TextLabel50 = Instance.new("TextLabel")
- Frame51 = Instance.new("Frame")
- TextLabel52 = Instance.new("TextLabel")
- 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")
- Frame68 = Instance.new("Frame")
- Frame69 = Instance.new("Frame")
- Frame70 = Instance.new("Frame")
- Frame71 = Instance.new("Frame")
- Frame72 = Instance.new("Frame")
- Frame73 = Instance.new("Frame")
- Frame74 = Instance.new("Frame")
- Frame75 = Instance.new("Frame")
- Frame76 = Instance.new("Frame")
- Frame77 = Instance.new("Frame")
- Frame78 = Instance.new("Frame")
- TextLabel79 = Instance.new("TextLabel")
- TextLabel80 = Instance.new("TextLabel")
- TextLabel81 = Instance.new("TextLabel")
- Frame82 = Instance.new("Frame")
- TextLabel83 = Instance.new("TextLabel")
- TextLabel84 = Instance.new("TextLabel")
- ImageLabel85 = Instance.new("ImageLabel")
- NumberValue86 = Instance.new("NumberValue")
- TextLabel87 = Instance.new("TextLabel")
- Frame88 = Instance.new("Frame")
- TextLabel89 = Instance.new("TextLabel")
- Frame90 = Instance.new("Frame")
- ImageLabel91 = Instance.new("ImageLabel")
- ImageLabel92 = Instance.new("ImageLabel")
- Frame93 = Instance.new("Frame")
- Frame94 = Instance.new("Frame")
- LocalScript95 = Instance.new("LocalScript")
- Frame96 = Instance.new("Frame")
- Frame97 = Instance.new("Frame")
- ImageLabel98 = Instance.new("ImageLabel")
- ImageLabel99 = Instance.new("ImageLabel")
- TextLabel100 = Instance.new("TextLabel")
- Frame101 = Instance.new("Frame")
- ImageLabel102 = Instance.new("ImageLabel")
- TextLabel103 = Instance.new("TextLabel")
- Frame104 = Instance.new("Frame")
- TextLabel105 = Instance.new("TextLabel")
- Frame106 = Instance.new("Frame")
- TextLabel107 = Instance.new("TextLabel")
- Frame108 = Instance.new("Frame")
- TextLabel109 = Instance.new("TextLabel")
- Frame110 = Instance.new("Frame")
- TextLabel111 = Instance.new("TextLabel")
- Part112 = Instance.new("Part")
- Part113 = Instance.new("Part")
- SpecialMesh114 = Instance.new("SpecialMesh")
- Part115 = Instance.new("Part")
- SpecialMesh116 = Instance.new("SpecialMesh")
- Part117 = Instance.new("Part")
- SpecialMesh118 = Instance.new("SpecialMesh")
- Part119 = Instance.new("Part")
- SpecialMesh120 = Instance.new("SpecialMesh")
- Tool0.Name = "DESERT EAGLE"
- Tool0.Parent = mas
- IntValue1.Name = "Ammo"
- IntValue1.Parent = Tool0
- IntValue1.Value = 8
- IntValue2.Name = "ClipSize"
- IntValue2.Parent = Tool0
- IntValue2.Value = 8
- Script3.Name = "serverMain"
- Script3.Parent = Tool0
- table.insert(cors,sandbox(Script3,function()
- local Plyr = script:WaitForChild("Plyr")
- local Gun = script.Parent
- local Handle = Gun:WaitForChild("Handle")
- local V3 = Vector3.new
- local CF, CFANG = CFrame.new, CFrame.Angles
- local RAD = math.rad
- local numLerp = function(A, B, Alpha)
- return A + (B - A) * Alpha
- end
- local inList = function(Element, List)
- for _, v in pairs(List) do
- if v == Element then
- return true
- end
- end
- return false
- end
- local getObject = function(Model, Class, Name)
- for _, v in pairs(Model:GetChildren()) do
- if v:IsA(Class) and v.Name == Name then
- return v
- end
- end
- return nil
- end
- ----------------------------------------------------------------------
- --------------------[ IGNORE MODEL HANDLING ]-------------------------
- ----------------------------------------------------------------------
- wait(math.random(0, 20) / 40) --This is to prevent more than one ignoreModel from being created
- if _G.ignoreCode then --If the ignoreCode already exists, then the script creates the ignoreModel
- --[[
- The purpose of this is so that every gun in a game that uses this gun kit will share one ignoreModel. 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("ignoreModel_".._G.ignoreCode)) then
- local ignoreModel = Instance.new("Model")
- ignoreModel.Name = "ignoreModel_".._G.ignoreCode
- ignoreModel.Parent = game.Workspace
- local grenadeFolder = Instance.new("Model")
- grenadeFolder.Name = "grenadeFolder"
- grenadeFolder.Parent = ignoreModel
- spawn(function()
- while true do
- ignoreModel.Parent = game.Workspace
- grenadeFolder.Parent = ignoreModel
- wait(1 / 20)
- end
- end)
- end
- script.Parent:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value = _G.ignoreCode
- else
- --[[
- If there isn't already an ignoreCode, then this creates one. The purpose of it being random is so that if there is
- an ignoreModel for something else in the game, the script won't end up placing the ignored objects in that ignoreModel
- --]]
- _G.ignoreCode = math.random(1, 1e4)
- if (not game.Workspace:FindFirstChild("ignoreModel_".._G.ignoreCode)) then
- local ignoreModel = Instance.new("Model")
- ignoreModel.Name = "ignoreModel_".._G.ignoreCode
- ignoreModel.Parent = game.Workspace
- local grenadeFolder = Instance.new("Model")
- grenadeFolder.Name = "grenadeFolder"
- grenadeFolder.Parent = ignoreModel
- spawn(function()
- while true do
- ignoreModel.Parent = game.Workspace
- grenadeFolder.Parent = ignoreModel
- wait(1 / 20)
- end
- end)
- end
- script.Parent:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value = _G.ignoreCode
- end
- spawn(function()
- --[[
- This function deletes any Player Folders that were left in the ignoreModel because the player left the game without
- deselecting the Gun first
- --]]
- repeat wait() until _G.ignoreCode
- local ignoreModel = game.Workspace:WaitForChild("ignoreModel_".._G.ignoreCode)
- while true do
- for _, gunIgnore in pairs(ignoreModel:GetChildren()) do
- if gunIgnore.Name ~= "grenadeFolder" then
- if (not game.Players:FindFirstChild(gunIgnore.Name:sub(11))) then
- gunIgnore:Destroy()
- end
- end
- end
- wait(1 / 20)
- end
- end)
- ----------------------------------------------------------------------
- --------------------[ RESET CAMERA ]----------------------------------
- ----------------------------------------------------------------------
- Gun.ChildRemoved:connect(function(Child)
- if Child == Handle and Plyr.Value then
- local ignoreCode = Gun:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value
- local resetCam = script:WaitForChild("resetCam")
- resetCam:WaitForChild("ignoreCode").Value = ignoreCode
- resetCam.Parent = Plyr.Value.PlayerGui
- end
- end)
- ----------------------------------------------------------------------
- --------------------[ GET WELD CFRAMES ]------------------------------
- ----------------------------------------------------------------------
- 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
- if string.sub(v.Name, 1, 3) == "Mag" then
- if (not v:FindFirstChild("magTrans")) then
- local magTrans = Instance.new("NumberValue")
- magTrans.Name = "magTrans"
- magTrans.Value = v.Transparency
- magTrans.Parent = v
- end
- end
- v.Anchored = true
- v.CanCollide = false
- end
- end
- Handle.Anchored = false
- Handle.CanCollide = true
- ----------------------------------------------------------------------
- --------------------[ GUNSETUP HANDLING ]-----------------------------
- ----------------------------------------------------------------------
- local gunSetup = script:WaitForChild("gunSetup")
- function gunSetup.OnServerInvoke(Player, Vars)
- --------------------[ CREATING IGNORE MODELS ]--------------------------------
- local gunIgnore = Instance.new("Model")
- gunIgnore.Name = "gunIgnore_"..Player.Name
- gunIgnore.Parent = Vars.ignoreModel
- --------------------[ MODIFYING THE PLAYER ]----------------------------------
- Vars.Humanoid.AutoRotate = false
- Vars.Shoulders.Right.Part1 = nil
- Vars.Shoulders.Left.Part1 = nil
- local playerFolder = Instance.new("Model")
- playerFolder.Name = "playerFolder"
- playerFolder.Parent = gunIgnore
- local headBase = Instance.new("Part")
- headBase.Transparency = 1
- headBase.Name = "headBase"
- headBase.CanCollide = false
- headBase.FormFactor = Enum.FormFactor.Custom
- headBase.Size = V3(0.2, 0.2, 0.2)
- headBase.BottomSurface = Enum.SurfaceType.Smooth
- headBase.TopSurface = Enum.SurfaceType.Smooth
- headBase.Parent = playerFolder
- local headWeld = Instance.new("Weld")
- headWeld.Part0 = Vars.Torso
- headWeld.Part1 = headBase
- headWeld.C0 = CF(0, 1.5, 0)
- headWeld.Parent = Vars.Torso
- local headWeld2 = Instance.new("Weld")
- headWeld2.Part0 = headBase
- headWeld2.Part1 = Vars.Head
- headWeld2.Parent = headBase
- local animBase = Instance.new("Part")
- animBase.Transparency = 1
- animBase.Name = "animBase"
- animBase.CanCollide = false
- animBase.FormFactor = Enum.FormFactor.Custom
- animBase.Size = V3(0.2, 0.2, 0.2)
- animBase.BottomSurface = Enum.SurfaceType.Smooth
- animBase.TopSurface = Enum.SurfaceType.Smooth
- animBase.Parent = playerFolder
- local animWeld = Instance.new("Weld")
- animWeld.Part0 = animBase
- animWeld.Part1 = headBase
- animWeld.Parent = animBase
- local armBase = Instance.new("Part")
- armBase.Transparency = 1
- armBase.Name = "ArmBase"
- armBase.CanCollide = false
- armBase.FormFactor = Enum.FormFactor.Custom
- armBase.Size = V3(0.2, 0.2, 0.2)
- armBase.BottomSurface = Enum.SurfaceType.Smooth
- armBase.TopSurface = Enum.SurfaceType.Smooth
- armBase.Parent = playerFolder
- local 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 = V3(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 = V3(0.2, 0.2, 0.2)
- RArmBase.BottomSurface = Enum.SurfaceType.Smooth
- RArmBase.TopSurface = Enum.SurfaceType.Smooth
- RArmBase.Parent = playerFolder
- local LWeld = Instance.new("Weld")
- LWeld.Name = "LWeld"
- LWeld.Part0 = armBase
- LWeld.Part1 = LArmBase
- LWeld.C0 = Vars.armC0[1]
- LWeld.C1 = Vars.leftArmC1
- LWeld.Parent = armBase
- local RWeld = Instance.new("Weld")
- RWeld.Name = "RWeld"
- RWeld.Part0 = armBase
- RWeld.Part1 = RArmBase
- RWeld.C0 = Vars.armC0[2]
- RWeld.C1 = Vars.rightArmC1
- RWeld.Parent = armBase
- local LWeld2 = Instance.new("Weld")
- LWeld2.Name = "LWeld"
- LWeld2.Part0 = LArmBase
- LWeld2.Part1 = Vars.LArm
- LWeld2.Parent = LArmBase
- local RWeld2 = Instance.new("Weld")
- RWeld2.Name = "RWeld"
- RWeld2.Part0 = RArmBase
- RWeld2.Part1 = Vars.RArm
- RWeld2.Parent = RArmBase
- local LLegWeld = Instance.new("Weld")
- LLegWeld.Name = "LLegWeld"
- LLegWeld.Part0 = Vars.Torso
- LLegWeld.Part1 = nil
- LLegWeld.C0 = CF(-0.5, -2, 0)
- LLegWeld.Parent = Vars.Torso
- local RLegWeld = Instance.new("Weld")
- RLegWeld.Name = "RLegWeld"
- RLegWeld.Part0 = Vars.Torso
- RLegWeld.Part1 = nil
- RLegWeld.C0 = CF(0.5, -2, 0)
- RLegWeld.Parent = Vars.Torso
- for _, Tab in pairs(Vars.gunParts) do
- Tab.Obj.Anchored = false
- local Weld = Instance.new("Weld")
- Weld.Name = "mainWeld"
- Weld.Part0 = Vars.Handle
- Weld.Part1 = Tab.Obj
- Weld.C0 = Tab.Obj.weldCF.Value
- Weld.Parent = Vars.Handle
- Tab.Weld = Weld
- end
- return gunIgnore, playerFolder, headWeld, headWeld2, animWeld, ABWeld, LWeld, RWeld, LWeld2, RWeld2, LLegWeld, RLegWeld, Vars.gunParts
- end
- ----------------------------------------------------------------------
- --------------------[ TWEENJOINT HANDLING ]---------------------------
- ----------------------------------------------------------------------
- local createTweenIndicator = script:WaitForChild("createTweenIndicator")
- function createTweenIndicator.OnServerInvoke(_, Joint, newCode)
- local tweenIndicator = nil
- 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
- return tweenIndicator
- end
- local lerpCF = script:WaitForChild("lerpCF")
- function lerpCF.OnServerInvoke(_, Joint, Prop, startCF, endCF, Alpha)
- spawn(function()
- Joint[Prop] = startCF:lerp(endCF, Alpha)
- end)
- end
- local deleteTweenIndicator = script:WaitForChild("deleteTweenIndicator")
- function deleteTweenIndicator.OnServerInvoke(_, tweenIndicator, newCode)
- 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
- ----------------------------------------------------------------------
- --------------------[ BULLET IMPACT HANDLING ]------------------------
- ----------------------------------------------------------------------
- local createBulletImpact = script:WaitForChild("createBulletImpact")
- createBulletImpact.OnServerEvent:connect(function(_, H, P, N, D, humanoidFound, gunIgnore, S)
- local surfaceCF = CF(P, P + N)
- ----------------------------------------------------------------------------------
- --Creating the bullet hole--------------------------------------------------------
- ----------------------------------------------------------------------------------
- if S.bulletHoles and (not humanoidFound) then
- local Hole = Instance.new("Part")
- Hole.Transparency = 1
- Hole.Anchored = true
- Hole.CanCollide = false
- Hole.FormFactor = "Custom"
- Hole.Size = V3(1, 1, 0.2)
- Hole.TopSurface = 0
- Hole.BottomSurface = 0
- local Mesh = Instance.new("BlockMesh")
- Mesh.Offset = V3(0, 0, -0.05)
- Mesh.Scale = V3(S.holeSettings.Size, S.holeSettings.Size, 0)
- Mesh.Parent = Hole
- local Decal = Instance.new("Decal")
- Decal.Face = Enum.NormalId.Front
- Decal.Texture = S.holeSettings.Texture
- Decal.Parent = Hole
- Hole.Parent = gunIgnore
- Hole.CFrame = surfaceCF
- if (not H.Anchored) then
- local Weld = Instance.new("Weld", Hole)
- Weld.Part0 = H
- Weld.Part1 = Hole
- Weld.C0 = H.CFrame:toObjectSpace(surfaceCF)
- Hole.Anchored = false
- end
- delay(S.holeSettings.visibleTime, function()
- if S.holeSettings.disappearTime > 0 then
- local t0 = tick()
- while true do
- local Alpha = math.min((tick() - t0) / S.holeSettings.disappearTime, 1)
- Decal.Transparency = numLerp(0, 1, Alpha)
- if Alpha == 1 then break end
- wait()
- end
- Hole:Destroy()
- else
- Hole:Destroy()
- end
- end)
- end
- ----------------------------------------------------------------------------------
- --Creating the spark effect-------------------------------------------------------
- ----------------------------------------------------------------------------------
- if S.bulletSparks and (not humanoidFound) and inList(H.Material, S.sparkSettings.Materials) then
- local Sparks = Instance.new("Part")
- Sparks.Transparency = 1
- Sparks.Anchored = true
- Sparks.CanCollide = false
- Sparks.FormFactor = "Custom"
- Sparks.Size = V3(1, 1, 1)
- Sparks.TopSurface = 0
- Sparks.BottomSurface = 0
- local Particles = nil
- if S.customSparks then
- Particles = getObject(game.ServerStorage, "ParticleEmitter", "bulletSpark"):Clone()
- else
- Particles = Instance.new("ParticleEmitter")
- Particles.Color = ColorSequence.new(S.sparkSettings.Color.Start, S.sparkSettings.Color.End)
- Particles.LightEmission = 1
- Particles.Size = NumberSequence.new(
- {
- NumberSequenceKeypoint.new(0, S.sparkSettings.Size, 0.25);
- NumberSequenceKeypoint.new(1, 0);
- }
- )
- Particles.Texture = S.sparkSettings.Texture
- Particles.Transparency = NumberSequence.new(0)
- Particles.Acceleration = V3(0, -196.2, 0)
- Particles.EmissionDirection = Enum.NormalId.Front
- Particles.Lifetime = NumberRange.new(S.sparkSettings.Lifetime - 0.05, S.sparkSettings.Lifetime + 0.05)
- Particles.Rate = S.sparkSettings.Rate
- Particles.Rotation = NumberRange.new(0, 360)
- Particles.Speed = NumberRange.new(S.sparkSettings.Speed - 5, S.sparkSettings.Speed + 5)
- Particles.VelocitySpread = S.sparkSettings.Spread
- end
- Particles.Parent = Sparks
- Sparks.Parent = gunIgnore
- Sparks.CFrame = surfaceCF
- if (not H.Anchored) then
- local Weld = Instance.new("Weld", Sparks)
- Weld.Part0 = H
- Weld.Part1 = Sparks
- Weld.C0 = H.CFrame:toObjectSpace(surfaceCF)
- Sparks.Anchored = false
- end
- delay(0.1, function()
- Particles.Enabled = false
- wait(Particles.Lifetime.Max)
- Sparks:Destroy()
- end)
- end
- ----------------------------------------------------------------------------------
- --Creating the smoke effect-------------------------------------------------------
- ----------------------------------------------------------------------------------
- if S.bulletSmoke and (not humanoidFound) then
- local Smoke = Instance.new("Part")
- Smoke.Transparency = 1
- Smoke.Anchored = true
- Smoke.CanCollide = false
- Smoke.FormFactor = "Custom"
- Smoke.Size = V3(1, 1, 1)
- Smoke.TopSurface = 0
- Smoke.BottomSurface = 0
- local Particles = Instance.new("ParticleEmitter")
- Particles.Color = ColorSequence.new(S.smokeSettings.objColor and H.Color or S.smokeSettings.Color)
- Particles.LightEmission = 0
- Particles.Size = NumberSequence.new(
- {
- NumberSequenceKeypoint.new(0, S.smokeSettings.Size.Start);
- NumberSequenceKeypoint.new(1, S.smokeSettings.Size.End);
- }
- )
- Particles.Texture = S.smokeSettings.Texture
- Particles.Transparency = NumberSequence.new(
- {
- NumberSequenceKeypoint.new(0, S.smokeSettings.startTransparency);
- NumberSequenceKeypoint.new(0.5, 0.75 * S.smokeSettings.startTransparency + 0.25);
- NumberSequenceKeypoint.new(1, 1);
- }
- )
- Particles.Acceleration = V3(0, -196.2, 0)
- Particles.EmissionDirection = Enum.NormalId.Front
- Particles.Lifetime = NumberRange.new(S.smokeSettings.Lifetime - 0.05, S.smokeSettings.Lifetime + 0.05)
- Particles.Rate = S.smokeSettings.Rate
- Particles.Rotation = NumberRange.new(0, 360)
- Particles.RotSpeed = NumberRange.new(10)
- Particles.Speed = NumberRange.new(S.smokeSettings.Speed - 5, S.smokeSettings.Speed + 5)
- Particles.VelocitySpread = S.smokeSettings.Spread
- Particles.Parent = Smoke
- Smoke.Parent = gunIgnore
- Smoke.CFrame = surfaceCF
- if (not H.Anchored) then
- local Weld = Instance.new("Weld", Smoke)
- Weld.Part0 = H
- Weld.Part1 = Smoke
- Weld.C0 = H.CFrame:toObjectSpace(surfaceCF)
- Smoke.Anchored = false
- end
- delay(0.1, function()
- Particles.Enabled = false
- wait(S.smokeSettings.Lifetime + 0.05)
- Smoke:Destroy()
- end)
- end
- end)
- ----------------------------------------------------------------------
- --------------------[ SHOCKWAVE HANDLING ]----------------------------
- ----------------------------------------------------------------------
- local createShockwave = script:WaitForChild("createShockwave")
- createShockwave.OnServerEvent:connect(function(_, Center, Radius, gunIgnore, S)
- local Shockwave = Instance.new("Part")
- Shockwave.BrickColor = S.shockwaveSettings.Color
- Shockwave.Material = Enum.Material.SmoothPlastic
- Shockwave.Name = "Shockwave"
- Shockwave.Anchored = true
- Shockwave.CanCollide = false
- Shockwave.FormFactor = Enum.FormFactor.Symmetric
- Shockwave.Size = V3(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 = V3()
- Mesh.Parent = Shockwave
- Shockwave.Parent = gunIgnore
- Shockwave.CFrame = CF(Center)
- spawn(function()
- local t0 = tick()
- while true do
- local Alpha = math.min((tick() - t0) / S.shockwaveSettings.Duration, 1)
- local Scale = 2 * Radius * Alpha
- Mesh.Scale = V3(Scale, Scale, Scale)
- Shockwave.Transparency = Alpha
- if Alpha == 1 then break end
- wait()
- end
- Shockwave:Destroy()
- end)
- end)
- ----------------------------------------------------------------------
- --------------------[ BLOOD HANDLING ]--------------------------------
- ----------------------------------------------------------------------
- local createBlood = script:WaitForChild("createBlood")
- createBlood.OnServerEvent:connect(function(_, H, P, D, gunIgnore, S)
- local bloodCF = CF(P, P + D) * CFANG(RAD(-90), 0, 0)
- local Blood = Instance.new("Part")
- Blood.Transparency = 1
- Blood.Anchored = true
- Blood.CanCollide = false
- Blood.FormFactor = "Custom"
- Blood.Size = V3(0.2, 1, 0.2)
- Blood.TopSurface = 0
- Blood.BottomSurface = 0
- local Particles = Instance.new("ParticleEmitter")
- Particles.Color = ColorSequence.new(S.bloodSettings.Color)
- Particles.LightEmission = 0
- Particles.Size = NumberSequence.new(S.bloodSettings.Size)
- Particles.Texture = S.bloodSettings.Texture
- Particles.Transparency = NumberSequence.new(
- {
- NumberSequenceKeypoint.new(0, S.bloodSettings.startTransparency);
- NumberSequenceKeypoint.new(1, 1);
- }
- )
- Particles.EmissionDirection = Enum.NormalId.Top
- Particles.Lifetime = NumberRange.new(S.bloodSettings.Lifetime - 0.05, S.bloodSettings.Lifetime + 0.05)
- Particles.Rate = S.bloodSettings.Rate
- Particles.Rotation = NumberRange.new(0, 90)
- Particles.Speed = NumberRange.new(S.bloodSettings.Speed)
- Particles.VelocitySpread = S.bloodSettings.Spread
- Particles.Parent = Blood
- Blood.Parent = gunIgnore
- Blood.CFrame = bloodCF
- if (not H.Anchored) then
- local Weld = Instance.new("Weld", Blood)
- Weld.Part0 = H
- Weld.Part1 = Blood
- Weld.C0 = H.CFrame:toObjectSpace(bloodCF)
- Blood.Anchored = false
- end
- delay(0.15, function()
- Particles.Enabled = false
- wait(S.bloodSettings.Lifetime + 0.05)
- Blood:Destroy()
- end)
- end)
- ----------------------------------------------------------------------
- --------------------[ TRAIL HANDLING ]--------------------------------
- ----------------------------------------------------------------------
- local createTrail = script:WaitForChild("createTrail")
- createTrail.OnServerEvent:connect(function(_, Origin, P, gunIgnore, S)
- local Trail = Instance.new("Part")
- Trail.BrickColor = S.trailSettings.Color
- Trail.Transparency = S.trailSettings.Transparency
- Trail.Anchored = true
- Trail.CanCollide = false
- Trail.Size = V3(1, 1, 1)
- local Mesh = Instance.new("CylinderMesh")
- Mesh.Offset = V3(0, -(P - Origin).magnitude / 2, 0)
- Mesh.Scale = V3(S.trailSettings.Thickness, (P - Origin).magnitude, S.trailSettings.Thickness)
- Mesh.Parent = Trail
- Trail.Parent = gunIgnore
- Trail.CFrame = CF(Origin, P) * CFANG(RAD(90), 0, 0)
- delay(S.trailSettings.visibleTime, function()
- if S.trailSettings.disappearTime > 0 then
- local t0 = tick()
- while true do
- local Alpha = math.min((tick() - t0) / S.trailSettings.disappearTime, 1)
- Trail.Transparency = numLerp(S.trailSettings.Transparency, 1, Alpha)
- if Alpha == 1 then break end
- wait()
- end
- Trail:Destroy()
- else
- Trail:Destroy()
- end
- end)
- end)
- end))
- ObjectValue4.Name = "Plyr"
- ObjectValue4.Parent = Script3
- RemoteFunction5.Name = "getWeldCF"
- RemoteFunction5.Parent = Script3
- RemoteFunction6.Name = "gunSetup"
- RemoteFunction6.Parent = Script3
- RemoteFunction7.Name = "tweenJoint"
- RemoteFunction7.Parent = Script3
- RemoteEvent8.Name = "onRenderStep"
- RemoteEvent8.Parent = Script3
- RemoteFunction9.Name = "createTweenIndicator"
- RemoteFunction9.Parent = Script3
- RemoteFunction10.Name = "deleteTweenIndicator"
- RemoteFunction10.Parent = Script3
- RemoteFunction11.Name = "lerpCF"
- RemoteFunction11.Parent = Script3
- LocalScript12.Name = "resetCam"
- LocalScript12.Parent = Script3
- table.insert(cors,sandbox(LocalScript12,function()
- repeat wait() until game.Players.LocalPlayer.Character
- local Player = game.Players.LocalPlayer
- local Char = Player.Character
- local Humanoid = Char:WaitForChild("Humanoid")
- local Cam = game.Workspace.CurrentCamera
- local UIS = game:GetService("UserInputService")
- local ignoreCode = script:WaitForChild("ignoreCode")
- repeat wait() until ignoreCode.Value ~= 0
- local ignoreModel = game.Workspace:WaitForChild("ignoreModel_"..ignoreCode.Value)
- local gunIgnore = ignoreModel:FindFirstChild("gunIgnore_"..Player.Name)
- Cam.FieldOfView = 70
- Cam.CameraType = Enum.CameraType.Custom
- Cam:ClearAllChildren()
- UIS.MouseBehavior = Enum.MouseBehavior.Default
- UIS.MouseIconEnabled = true
- Player.CameraMode = Enum.CameraMode.Classic
- Humanoid.WalkSpeed = 16
- Humanoid.AutoRotate = true
- if gunIgnore then gunIgnore:Destroy() end
- end))
- IntValue13.Name = "ignoreCode"
- IntValue13.Parent = LocalScript12
- RemoteEvent14.Name = "createBulletImpact"
- RemoteEvent14.Parent = Script3
- RemoteEvent15.Name = "createShockwave"
- RemoteEvent15.Parent = Script3
- RemoteEvent16.Name = "createBlood"
- RemoteEvent16.Parent = Script3
- RemoteEvent17.Name = "createTrail"
- RemoteEvent17.Parent = Script3
- NumberValue18.Name = "StoredAmmo"
- NumberValue18.Parent = Tool0
- NumberValue18.Value = 10000000000000000
- Part19.Name = "Flame"
- Part19.Parent = Tool0
- Part19.BrickColor = BrickColor.new("Bright orange")
- Part19.Transparency = 1
- Part19.Rotation = Vector3.new(90, 0, -90)
- Part19.Anchored = true
- Part19.CanCollide = false
- Part19.FormFactor = Enum.FormFactor.Custom
- Part19.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
- Part19.CFrame = CFrame.new(-4.29561186, 1.00590098, -11.8051977, -5.96045311e-08, 1, -4.3696641e-08, 2.08189022e-12, -4.36966552e-08, -1, -1, -5.96045311e-08, -2.0783375e-12)
- Part19.BottomSurface = Enum.SurfaceType.Smooth
- Part19.TopSurface = Enum.SurfaceType.Smooth
- Part19.Color = Color3.new(0.854902, 0.521569, 0.254902)
- Part19.Position = Vector3.new(-4.29561186, 1.00590098, -11.8051977)
- Part19.Orientation = Vector3.new(90, 90, 0)
- Part19.Color = Color3.new(0.854902, 0.521569, 0.254902)
- ParticleEmitter20.Name = "1FlashFX[Smoke]"
- ParticleEmitter20.Parent = Part19
- ParticleEmitter20.Transparency = NumberSequence.new(0.60000002384186,1)
- ParticleEmitter20.Rotation = NumberRange.new(0, 360)
- ParticleEmitter20.Size = NumberSequence.new(0,0)
- ParticleEmitter20.Color = ColorSequence.new(Color3.new(0.27451, 0.27451, 0.27451),Color3.new(0.27451, 0.27451, 0.27451))
- ParticleEmitter20.Enabled = false
- ParticleEmitter20.LightEmission = 0.10000000149012
- ParticleEmitter20.Texture = "http://www.roblox.com/asset/?id=244514423"
- ParticleEmitter20.Lifetime = NumberRange.new(1.25, 1.5)
- ParticleEmitter20.Rate = 100
- ParticleEmitter20.RotSpeed = NumberRange.new(10, 10)
- ParticleEmitter20.Speed = NumberRange.new(5, 7)
- ParticleEmitter20.VelocitySpread = 15
- ParticleEmitter20.Color = ColorSequence.new(Color3.new(0.27451, 0.27451, 0.27451),Color3.new(0.27451, 0.27451, 0.27451))
- ParticleEmitter21.Name = "FlashFX[Flash]"
- ParticleEmitter21.Parent = Part19
- ParticleEmitter21.Transparency = NumberSequence.new(1,0.89999997615814,0.88749998807907,1)
- ParticleEmitter21.Size = NumberSequence.new(0,0)
- ParticleEmitter21.Color = ColorSequence.new(Color3.new(1, 1, 0.498039),Color3.new(1, 1, 0.498039))
- ParticleEmitter21.Enabled = false
- ParticleEmitter21.LightEmission = 1
- ParticleEmitter21.Texture = "http://www.roblox.com/asset/?id=242102147"
- ParticleEmitter21.Lifetime = NumberRange.new(0.050000000745058, 0.075000002980232)
- ParticleEmitter21.Rate = 1000
- ParticleEmitter21.RotSpeed = NumberRange.new(22, 22)
- ParticleEmitter21.Color = ColorSequence.new(Color3.new(1, 1, 0.498039),Color3.new(1, 1, 0.498039))
- PointLight22.Name = "FlashFX[Light]"
- PointLight22.Parent = Part19
- PointLight22.Color = Color3.new(1, 1, 0.498039)
- PointLight22.Enabled = false
- PointLight22.Brightness = 10
- PointLight22.Range = 6
- PointLight22.Shadows = true
- PointLight22.Color = Color3.new(1, 1, 0.498039)
- Part23.Name = "Handle"
- Part23.Parent = Tool0
- Part23.Material = Enum.Material.SmoothPlastic
- Part23.BrickColor = BrickColor.new("Dark stone grey")
- Part23.Transparency = 1
- Part23.Rotation = Vector3.new(0, -90, 0)
- Part23.Anchored = true
- Part23.CanCollide = false
- Part23.FormFactor = Enum.FormFactor.Custom
- Part23.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
- Part23.CFrame = CFrame.new(-5.54300022, 0.40200001, -11.7790003, -3.08347408e-05, -0.000127091931, -1.00000894, -3.03668912e-05, 1.00000048, -0.000127092004, 1, 3.03629586e-05, -3.08536582e-05)
- Part23.BottomSurface = Enum.SurfaceType.Smooth
- Part23.TopSurface = Enum.SurfaceType.Smooth
- Part23.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part23.Position = Vector3.new(-5.54300022, 0.40200001, -11.7790003)
- Part23.Orientation = Vector3.new(0.00999999978, -90, 0)
- Part23.Color = Color3.new(0.388235, 0.372549, 0.384314)
- BlockMesh24.Parent = Part23
- BlockMesh24.Scale = Vector3.new(0.25, 0.666666687, 0.25)
- BlockMesh24.Scale = Vector3.new(0.25, 0.666666687, 0.25)
- Sound25.Name = "Fire"
- Sound25.Parent = Part23
- Sound25.Pitch = 1.5
- Sound25.SoundId = "http://roblox.com/asset/?id=131205975"
- Sound26.Name = "MagOut"
- Sound26.Parent = Part23
- Sound26.SoundId = "rbxassetid://457042936"
- Sound26.Volume = 1
- Sound27.Name = "MagIn"
- Sound27.Parent = Part23
- Sound27.SoundId = "rbxassetid://456179899"
- Sound27.Volume = 1
- Part28.Name = "SightMark"
- Part28.Parent = Tool0
- Part28.Material = Enum.Material.Metal
- Part28.BrickColor = BrickColor.new("Black")
- Part28.Transparency = 1
- Part28.Rotation = Vector3.new(0, -90, 0)
- Part28.Anchored = true
- Part28.CanCollide = false
- Part28.FormFactor = Enum.FormFactor.Custom
- Part28.Size = Vector3.new(0.290894598, 0.200000003, 0.328429729)
- Part28.CFrame = CFrame.new(-7.83900023, 1.12, -11.802, -4.37113883e-08, 0, -1, 0, 1, 0, 1, 0, -4.37113883e-08)
- Part28.BottomSurface = Enum.SurfaceType.Smooth
- Part28.TopSurface = Enum.SurfaceType.Smooth
- Part28.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part28.Position = Vector3.new(-7.83900023, 1.12, -11.802)
- Part28.Orientation = Vector3.new(0, -90, 0)
- Part28.Color = Color3.new(0.105882, 0.164706, 0.207843)
- BlockMesh29.Parent = Part28
- BlockMesh29.Scale = Vector3.new(1, 0.234592363, 1)
- BlockMesh29.Scale = Vector3.new(1, 0.234592363, 1)
- LocalScript30.Name = "clientMain"
- LocalScript30.Parent = Tool0
- table.insert(cors,sandbox(LocalScript30,function()
- --------------------------------------------------------------------------------------
- --------------------[ CHARACTER LOADING ]---------------------------------------------
- --------------------------------------------------------------------------------------
- print("")
- repeat wait() until game.Players.LocalPlayer.Character
- repeat wait() until game.Players.LocalPlayer.Character:IsDescendantOf(game.Workspace)
- wait(1 / 20)
- --------------------------------------------------------------------------------------
- --------------------[ IGNORE MODEL ]--------------------------------------------------
- --------------------------------------------------------------------------------------
- local ignoreCode = script:WaitForChild("ignoreCode")
- repeat wait() until ignoreCode.Value ~= 0
- local ignoreModel = game.Workspace:WaitForChild("ignoreModel_"..ignoreCode.Value)
- local grenadeFolder = ignoreModel:WaitForChild("grenadeFolder")
- --------------------------------------------------------------------------------------
- --------------------[ CONSTANTS ]-----------------------------------------------------
- --------------------------------------------------------------------------------------
- local Gun = script.Parent
- local serverMain = Gun:WaitForChild("serverMain")
- local Handle = Gun:WaitForChild("Handle")
- local AimPart = Gun:WaitForChild("SightMark")
- local Main = Gun:WaitForChild("Flame")
- local Ammo = Gun:WaitForChild("Ammo")
- local ClipSize = Gun:WaitForChild("ClipSize")
- local StoredAmmo = Gun:WaitForChild("StoredAmmo")
- local createTweenIndicator = serverMain:WaitForChild("createTweenIndicator")
- local deleteTweenIndicator = serverMain:WaitForChild("deleteTweenIndicator")
- local getWeldCF = serverMain:WaitForChild("getWeldCF")
- local gunSetup = serverMain:WaitForChild("gunSetup")
- local lerpCF = serverMain:WaitForChild("lerpCF")
- local createBlood = serverMain:WaitForChild("createBlood")
- local createBulletImpact = serverMain:WaitForChild("createBulletImpact")
- local createShockwave = serverMain:WaitForChild("createShockwave")
- local createTrail = serverMain:WaitForChild("createTrail")
- local Particle = {}
- function Particle.new(Prop)
- ----------[ CONSTANTS ]--------------------
- local Cam = workspace.CurrentCamera
- local rayIgnore = Prop.rayIgnore or {} --If the property doesn't exist, then set it to it's default
- local Color = Prop.Color or Color3.new(1, 1, 1)
- local Length = Prop.Length or 1
- local Width = Prop.Width or 1
- local p0 = Prop.p0 or error("Particle.new requires a p0 (origin position) property!", 0) --Give an error message if you don't this
- local v0 = Prop.v0 or error("Particle.new requires a v0 (initial velocity) property!", 0)
- local a0 = Prop.a0 or error("Particle.new requires an a0 (initial acceleration) property!", 0)
- ----------[ VARIABLES ]--------------------
- local Deleted = false
- local p = p0 --Set the position, velocity, and acceleration as the intial conditions
- local v = v0
- local a = a0
- local t = 0
- ----------[ FUNCTIONS ]--------------------
- local function worldWidthToScreenWidth(Width, Depth) --A function I made that gives you a screen width given a world width and depth
- local Center = Cam.CoordinateFrame * CFrame.new(0, 0, -Depth)
- local wp1 = (Center * CFrame.new(0, Width / 2, 0)).p
- local wp2 = (Center * CFrame.new(0, -Width / 2, 0)).p
- local sp1 = Cam:WorldToScreenPoint(wp1) --Use the WorldToScreenPoint method of the camera to get the screen width from the world width
- local sp2 = Cam:WorldToScreenPoint(wp2)
- return (sp1 - sp2).magnitude
- end
- ----------[ MAIN PROGRAM ]-----------------
- local Container = Instance.new("Frame")
- Container.BackgroundTransparency = 1
- Container.Position = UDim2.new()
- Container.Size = UDim2.new()
- local Line = Instance.new("Frame")
- Line.BackgroundColor3 = Color
- Line.BorderSizePixel = 0
- Line.Position = UDim2.new()
- Line.Size = UDim2.new()
- Line.Parent = Container
- return setmetatable(
- {
- delete = function() --This function safely removes the particle
- Container:Destroy()
- Deleted = true
- end
- },
- {
- __index = function(_, Index)
- if Index == "p" or Index == "position" then --Return the world position of the particle
- return (Deleted and nil or p)
- elseif Index == "v" or Index == "velocity" then --Return the world velocity of the particle
- return (Deleted and nil or v)
- elseif Index == "obj" or Index == "object" then --Return the particle frame itself
- return (Deleted and nil or Container)
- else
- error(Index.." is not a member of Particle!", 0) --Give an error message if any other index is called
- end
- end;
- __newindex = function(_, Index, Value)
- if Index == "t" or Index == "time" and (not Deleted) then --Render the particle given a time value
- t = Value
- p = p0 + (v0 * t) + (0.5 * a0 * t * t) --update the position given the time
- v = v0 + (a0 * t) --update the velocity given the time
- local testRay1 = Ray.new(Cam.CoordinateFrame.p, (p + (v.unit * Length) / 2) - Cam.CoordinateFrame.p)
- local testRay2 = Ray.new(Cam.CoordinateFrame.p, (p - (v.unit * Length) / 2) - Cam.CoordinateFrame.p)
- local H1, _ = workspace:FindPartOnRayWithIgnoreList(testRay1, rayIgnore)
- local H2, _ = workspace:FindPartOnRayWithIgnoreList(testRay2, rayIgnore)
- if H1 and H2 then
- Line.Visible = false
- else
- local face1 = Cam:WorldToScreenPoint(p + (v.unit * Length) / 2) --Get the 2 endpoints of the particle in screen space
- local face2 = Cam:WorldToScreenPoint(p - (v.unit * Length) / 2)
- local Center, isVisible = Cam:WorldToScreenPoint(p) --Get the center of the particle in screen space
- local screenLength = (face1 - face2).magnitude
- local screenWidth = worldWidthToScreenWidth(Width, Center.Z)
- local Ang = math.atan2(face1.Y - face2.Y, face1.X - face2.X) --Get the angle the particle needs to be at in order to line up
- Line.Position = UDim2.new(0, 0, 0, -screenWidth / 2)
- Line.Size = UDim2.new(1, 0, 0, screenWidth)
- Line.Visible = isVisible --Make the particle invisible if the world point isn't on screen
- Container.Position = UDim2.new(
- 0,
- face2.X + (math.cos(Ang) - 1) * screenLength / 2, --Yay trig!
- 0,
- face2.Y + math.sin(Ang) * screenLength / 2
- )
- Container.Size = UDim2.new(0, screenLength, 0, 0)
- Container.Rotation = math.deg(Ang)
- end
- else
- error(Index.." is not a member of Particle!", 0) --Give an error message if any other index is being changed
- end
- end
- }
- )
- end
- local Spring = {}
- function Spring.new(Initial)
- local t0 = tick()
- local p0 = Initial or 0
- local v0 = Initial and Vector3.new() or 0
- local t = Initial or 0
- local d = 1
- local s = 1
- local function positionVelocity(Tick)
- local x = Tick - t0
- local c0 = p0 - t
- if s == 0 then
- return p0, 0
- elseif d < 1 then
- local c = math.sqrt(1 - d ^ 2)
- local c1 = (v0 / s + d * c0) / c
- local co = math.cos(c * s * x)
- local si = math.sin(c * s * x)
- local e = math.exp(d * s * x)
- local p = t + (c0 * co + c1 * si) / e
- local v = s * ((c * c1 - d * c0) * co - (c * c0 + d * c1) * si) / e
- return p, v
- else
- local c1 = v0 / s + c0
- local e = math.exp(s * x)
- local p = t + (c0 + c1 * s * x) / e
- local v = s * (c1 - c0 - c1 * s * x) / e
- return p, v
- end
- end
- return setmetatable(
- {
- accelerate = function(_, acceleration)
- local T = tick()
- local p, v = positionVelocity(T)
- p0 = p
- v0 = v + acceleration
- t0 = T
- end;
- },
- {
- __index = function(_, index)
- if index == "value" or index == "position" or index == "p" then
- local p, v = positionVelocity(tick())
- return p
- elseif index == "velocity" or index == "v" then
- local p, v = positionVelocity(tick())
- return v
- elseif index == "acceleration" or index == "a" then
- local x = tick() - t0
- local c0 = p0 - t
- if s == 0 then
- return 0
- elseif d < 1 then
- local c = math.sqrt(1 - d ^ 2)
- local c1 = (v0 / s + d * c0) / c
- local cs = (c0 * d ^ 2 - 2 * c * d * c1 - c0 * c ^ 2) * math.cos(c * s * x)
- local sn = (c1 * d ^ 2 + 2 * c * d * c0 - c1 * c ^ 2) * math.sin(c * s * x)
- return s ^ 2 *(cs + sn) / math.exp(d * s * x)
- else
- local c1 = v0 / s + c0
- return s ^ 2 * (c0 - 2 * c1 + c1 * s * x) / math.exp(s * x)
- end
- elseif index == "target" or index == "t" then
- return t
- elseif index == "damper" or index == "d" then
- return d
- elseif index == "speed" or index == "s" then
- return s
- elseif index == "magnitude" or index == "m" then
- local p, v = positionVelocity(tick())
- return p.magnitude
- else
- error(index.." is not a valid member of spring", 0)
- end
- end;
- __newindex = function(_, index, value)
- local T = tick()
- if index == "value" or index == "position" or index == "p" then
- local p, v = positionVelocity(T)
- p0, v0 = value, v
- elseif index == "velocity" or index == "v" then
- local p, v = positionVelocity(T)
- p0, v0 = p, value
- elseif index == "acceleration" or index == "a" then
- local p, v = positionVelocity(T)
- p0, v0 = p, v + value
- elseif index == "target" or index == "t" then
- p0, v0 = positionVelocity(T)
- t = value
- elseif index == "damper" or index == "d" then
- p0, v0 = positionVelocity(T)
- d = value < 0 and 0 or value < 1 and value or 1
- elseif index == "speed" or index == "s" then
- p0, v0 = positionVelocity(T)
- s = value < 0 and 0 or value
- else
- error(index.." is not a valid member of spring", 0)
- end
- t0 = T
- end;
- }
- )
- end
- local Anims = {
- Reload = function(S)
- local W1 = nil
- local W2 = nil
- local animSpeed = S.isMagEmpty() and S.reloadTimeEmpty / 1.3 or S.reloadTimeLoaded / 0.9
- return {
- function()
- if (not S.isNewMag()) then
- if S.isMagVisible() then
- local Mag1, magTable1 = S.createMag("Mag1")
- Mag1.Parent = S.gunIgnore
- W1 = Instance.new("Weld")
- W1.Part0 = magTable1[1].magClone
- W1.Part1 = S.Handle
- W1.C0 = magTable1[1].Original.CFrame:toObjectSpace(S.Handle.CFrame)
- W1.Parent = magTable1[1].magClone
- S.tweenJoint(S.LWeld, nil, S.CF(-1, 1.4, -1) * S.CFANG(S.RAD(-15), 0, S.RAD(-25)), S.Sine, 0.2 * animSpeed)
- S.tweenJoint(S.RWeld, nil, S.CF(.1, 1, -0.31) * S.CFANG(S.RAD(-12), 0, S.RAD(25)), S.Sine, 0.2 * animSpeed)
- S.tweenJoint(S.Grip, nil, S.CFANG(0, S.RAD(20), S.RAD(10)), S.Sine, 0.1 * animSpeed)
- wait(0.2 * animSpeed)
- end
- end
- end;
- function()
- if (not S.isNewMag()) then
- if S.isMagVisible() then
- S.makeMagInvisible()
- W1:Destroy()
- local Mag1, magTable1 = S.getMag("Mag1")
- magTable1[1].magClone.Velocity = S.Handle.Velocity + S.Handle.CFrame:vectorToWorldSpace(S.V3(0, -1, 0)) * 20
- S.tweenJoint(S.RWeld, nil, S.CF(0.3, 0.2, -0.5) * S.CFANG(S.RAD(-20), S.RAD(10), S.RAD(25)), S.Sine, 0.25 * animSpeed)
- S.tweenJoint(S.Grip, nil, S.CFANG(0, S.RAD(20), S.RAD(10)), S.Sine, 0.2 * animSpeed)
- else
- S.tweenJoint(S.RWeld, nil, S.CF(.1, 1.2, -0.31) * S.CFANG(S.RAD(-12), S.RAD(20), S.RAD(25)), S.Sine, 0.2 * animSpeed)
- S.tweenJoint(S.Grip, nil, S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10)), S.Sine, 0.2 * animSpeed)
- end
- S.tweenJoint(S.LWeld, nil, S.CF(0, 0.5, 0) * S.CFANG(S.RAD(95), 0, S.RAD(-25)), S.Sine, 0.2 * animSpeed)
- wait(0.25 * animSpeed)
- end
- end;
- function()
- if (not S.isNewMag()) then
- local Mag1, magTable1 = S.getMag("Mag1")
- if Mag1 then Mag1:Destroy() end
- local Mag2, magTable2 = S.createMag("Mag2")
- Mag2.Parent = S.gunIgnore
- local LArmCF = S.LWeld.Part0.CFrame * S.LWeld.C0 * (S.CF(0.58, 1.63, -1.4) * S.CFANG(S.RAD(-22), S.RAD(20), S.RAD(-60))):inverse()
- local RArmCF = S.RWeld.Part0.CFrame * S.RWeld.C0 * (S.CF(-.1, 1.2, -0.31) * S.CFANG(S.RAD(-0), S.RAD(20), S.RAD(25))):inverse()
- local handleOffsetCF = S.RArm.CFrame:toObjectSpace(S.RArm.CFrame * S.Grip.C0 * (S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10))):inverse())
- local originalMagOffsetCF = S.Handle.CFrame:toObjectSpace(magTable2[1].Original.CFrame)
- local newMagC0 = LArmCF:toObjectSpace(RArmCF * handleOffsetCF * originalMagOffsetCF)
- W2 = Instance.new("Weld")
- W2.Part0 = S.LArm
- W2.Part1 = magTable2[1].magClone
- W2.C0 = newMagC0
- W2.Parent = magTable2[1].magClone
- S.tweenJoint(S.LWeld, nil, S.CF(0.55, 1, -2.4) * S.CFANG(S.RAD(-20), S.RAD(20), S.RAD(-60)), S.Sine, 0.2 * animSpeed)--0.25
- S.tweenJoint(S.RWeld, nil, S.CF(0, 1.2, -0.61) * S.CFANG(S.RAD(-12), S.RAD(20), S.RAD(25)), S.Sine, 0.2 * animSpeed)
- S.tweenJoint(S.Grip, nil, S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10)), S.Sine, 0.2 * animSpeed)
- wait(0.2 * animSpeed)
- end
- end;
- function()
- if (not S.isNewMag()) then
- S.tweenJoint(S.Grip, nil, S.CFANG(S.RAD(-10), S.RAD(20), S.RAD(10)), S.Sine, 0.15 * animSpeed)
- S.tweenJoint(S.LWeld, nil, S.CF(0.58, 1.63, -1.4) * S.CFANG(S.RAD(-22), S.RAD(20), S.RAD(-60)), S.Sine, 0.15 * animSpeed)--0.25
- S.tweenJoint(S.RWeld, nil, S.CF(0, 1.2, -0.61) * S.CFANG(S.RAD(-15), S.RAD(20), S.RAD(25)), S.Sine, 0.2 * animSpeed)
- wait(0.2 * animSpeed)
- end
- end;
- function()
- if (not S.isNewMag()) then
- local Mag1, _ = S.getMag("Mag1")
- local Mag2, _ = S.getMag("Mag2")
- S.makeMagVisible()
- S.setNewMag()
- if Mag1 then Mag1:Destroy() end
- Mag2:Destroy()
- end
- end;
- function()
- if S.isMagEmpty() then
- if S.isNewMag() then
- end
- end
- end;
- }
- end;
- Cocking = function(S)
- end;
- Crawling = function(X, moveDirection, moveSpeed)
- return {
- leftArm = CFrame.Angles(
- 0,
- math.rad(90),
- math.rad(-10)
- ) * CFrame.new(
- math.sin(moveDirection) * (math.sin(X * 6) / 4) - 0.2,
- math.cos(moveDirection) * (math.sin(X * 6) / 2) - 0.1,
- math.max(math.cos(X * 6) / 4, 0) - 0.1
- ) * CFrame.Angles(
- -math.max(math.cos(X * 6) / 4, 0),
- 0,
- 0
- );
- leftLeg = CFrame.new(
- math.sin(moveDirection) * (-math.sin(X * 6) / 4) - 0.2,
- math.cos(moveDirection) * (math.sin(X * 6) / 2) + 0.3,
- math.max(math.cos(X * 6) / 4, 0) - 0.1
- ):inverse() * CFrame.Angles(
- 0,
- 0,
- -math.rad(15) - math.cos(moveDirection) * (math.rad(15) * math.sin(X * 6))
- );
- rightArm = CFrame.Angles(
- 0,
- math.rad(-5),
- math.rad(10)
- ) * CFrame.new(
- math.sin(moveDirection) * (-math.sin(X * 6) / 4) + 0.2,
- math.cos(moveDirection) * (-math.sin(X * 6) / 5) - 0.2,
- math.max(math.cos((X + math.rad(30)) * 6) / 10, 0) - 0.1
- ) * CFrame.Angles(
- -math.max(math.cos((X + math.rad(30)) * 6) / 10, 0),
- 0,
- 0
- );
- rightLeg = CFrame.new(
- math.sin(moveDirection) * (math.sin(X * 6) / 4) + 0.2,
- math.cos(moveDirection) * (-math.sin(X * 6) / 2) + 0.3,
- math.max(math.cos((X + math.rad(30)) * 6) / 4, 0) - 0.1
- ):inverse() * CFrame.Angles(
- 0,
- 0,
- math.rad(15) - math.cos(moveDirection) * (math.rad(15) * math.sin(X * 6))
- );
- Grip = CFrame.Angles(
- math.max(math.cos((X + math.rad(30)) * 6) / 7, 0),
- math.rad(5),
- 0
- );
- Camera = 1.5 * math.rad(math.cos((X + math.rad(30)) * 6)) + math.rad(0.5); --This is what the roll of the camera will be when you're crawling
- }
- end;
- Idling = {
- unAimed = function(X)
- return {
- Pos = Vector3.new(
- math.sin(X / 2) / 70,
- math.sin(X * 5 / 4) / 70,
- math.sin(X * 3 / 4) / 70
- );
- Rot = Vector3.new(
- 0,
- 0,
- 0
- );
- }
- end;
- Aimed = function(X)
- return {
- Pos = Vector3.new(
- math.sin(X * 3 / 8) / 140,
- math.sin(X * 15 / 16) / 140,
- 0
- );
- Rot = Vector3.new(
- 0,
- 0,
- 0
- );
- }
- end;
- };
- Walking = {
- unAimed = function(X)
- return {
- Pos = Vector3.new(
- 4 * math.sin(X * 4.5) / 50,
- 1.5 * math.sin(X * 9) / 50,
- 0
- );
- Rot = Vector3.new(
- 0,
- 0,
- math.rad(math.sin(X * 4.5)) * 2
- );
- }
- end;
- Aimed = function(X)
- return {
- Pos = Vector3.new(
- 2 * math.sin(X * 3) / 150,
- 0.75 * math.sin(X * 6) / 150,
- 0
- );
- Rot = Vector3.new(
- 0,
- 0,
- math.rad(math.sin(X * 3)) / 3
- );
- }
- end;
- };
- Running = function(X)
- return {
- Pos = Vector3.new(
- 4 * math.sin(X * 3.5 * 1.5) / 30,
- 1.5 * math.sin(X * 9 * 1.5) / 40 + 0.2,
- 0
- );
- Rot = Vector3.new(
- 0,
- -math.rad(math.sin(X * 4.5 * 1.5)) * 5 + math.rad(3),
- math.rad(math.sin(X * 4.5 * 1.5)) * 5
- );
- }
- end;
- }
- local Plugins = {
- KeyDown = {
- { --This is a plugin for a toggleable laser
- Key = "v"; --This is the key you press to activate the plugin
- Description = "Toggle Laser"; --This is what the description of the key will be in the controls
- Plugin = function() --This is the actual plugin function
- local Laser = Gun:WaitForChild("Laser") --These few lines wait for the necessary bricks/models
- local Handle = Gun:WaitForChild("Handle")
- local ignoreCode = Gun.clientMain:WaitForChild("ignoreCode")
- local ignoreModel = game.Workspace:WaitForChild("ignoreModel_"..ignoreCode.Value)
- local PlyrName = game.Players:GetPlayerFromCharacter(Gun.Parent).Name
- local playerFolder = ignoreModel:WaitForChild("gunIgnore_"..PlyrName)
- local RS = game:GetService("RunService")
- local function createLaserDot() --This function creates the red laser dot
- local laserDot = Instance.new("Part")
- laserDot.Transparency = 1
- laserDot.Name = "laserDot"
- laserDot.Anchored = true
- laserDot.CanCollide = false
- laserDot.FormFactor = Enum.FormFactor.Custom
- laserDot.Size = Vector3.new(0.25, 0.25, 1)
- local laserGui = Instance.new("SurfaceGui")
- laserGui.CanvasSize = Vector2.new(100, 100)
- laserGui.Parent = laserDot
- local laserImage = Instance.new("ImageLabel")
- laserImage.BackgroundTransparency = 1
- laserImage.Size = UDim2.new(1, 0, 1, 0)
- laserImage.Image = "http://www.roblox.com/asset/?id=131394739"
- laserImage.Parent = laserGui
- --[[local laserLight = Instance.new("SurfaceLight")
- laserLight.Angle = 180
- laserLight.Brightness = math.huge
- laserLight.Color = Color3.new(1, 0, 0)
- laserLight.Face = Enum.NormalId.Back
- laserLight.Range = 5
- laserLight.Shadows = true
- laserLight.Parent = laserDot]]
- return laserDot
- end
- local function getHitSurfaceCFrame(Pos, Obj) --This function returns the proper cframe based on the face that the position is on
- local surfaceCF = {
- {"Back", Obj.CFrame * CFrame.new(0, 0, Obj.Size.z)};
- {"Bottom", Obj.CFrame * CFrame.new(0, -Obj.Size.y, 0)};
- {"Front", Obj.CFrame * CFrame.new(0, 0, -Obj.Size.z)};
- {"Left", Obj.CFrame * CFrame.new(-Obj.Size.x, 0, 0)};
- {"Right", Obj.CFrame * CFrame.new(Obj.Size.x, 0, 0)};
- {"Top", Obj.CFrame * CFrame.new(0, Obj.Size.y, 0)}
- }
- local closestDist = math.huge
- local closestSurface = nil
- for _,v in pairs(surfaceCF) do
- local surfaceDist = (Pos - v[2].p).magnitude
- if surfaceDist < closestDist then
- closestDist = surfaceDist
- closestSurface = v
- end
- end
- local surfaceDir = CFrame.new(Obj.CFrame.p, closestSurface[2].p)
- local surfaceDist = surfaceDir.lookVector * ((Obj.CFrame.p - closestSurface[2].p).magnitude / 2 - 0.25)
- local surfaceOffset = Pos - closestSurface[2].p + surfaceDist
- local surfaceCFrame = surfaceDir + surfaceDist + surfaceOffset
- return surfaceCFrame
- end
- local laserDot = createLaserDot() --The code is cleaner when the laser creating code is in a function
- Laser.Transparency = (Laser.Transparency == 1 and 0 or 1) --Toggles the laser on or off
- while math.floor(Laser.Transparency) == 0 do --This loop will keep running as long as the laser is visible
- if (not game.Players:GetPlayerFromCharacter(Gun.Parent)) then break end --This checks if the gun is a child of the character
- local newRay = Ray.new(Laser.Position, Handle.CFrame.lookVector * 999)
- local H, P = game.Workspace:FindPartOnRay(newRay, ignoreModel)
- local Distance = (P - Laser.Position).magnitude
- Laser.Mesh.Offset = Vector3.new(0, Distance / 2, 0)
- Laser.Mesh.Scale = Vector3.new(0.075, Distance / 0.2, 0.075)
- if H then
- laserDot.CFrame = getHitSurfaceCFrame(P, H) --If the laser hits a part then position the dot on the part
- laserDot.Parent = playerFolder
- else
- laserDot.Parent = nil --If the laser doesn't hit a part then temporarily remove the laser dor
- end
- RS.RenderStepped:wait()
- end
- laserDot:Destroy() --These lines reset the laser if the laser is transparent or the gun was deselected
- Laser.Transparency = 1
- Laser.Mesh.Offset = Vector3.new()
- Laser.Mesh.Scale = Vector3.new(0.075, 0, 0.075)
- end;
- };
- { --This is a plugin for a toggleable flashlight
- Key = "z";
- Description = "Toggle Flashlight";
- Plugin = function()
- local Flashlight = Gun:WaitForChild("Flashlight")
- if Flashlight then
- for _, Light in pairs(Flashlight:GetChildren()) do
- if Light.Name == "Light" then
- Light.Enabled = (not Light.Enabled)
- end
- end
- end
- end
- };
- };
- KeyUp = {
- };
- Firing = {
- Plugin = function()
- --Put code here
- end;
- };
- Aimed = {
- Plugin = function()
- --Put code here
- end;
- };
- UnAimed = {
- Plugin = function()
- --Put code here
- end;
- };
- OnEquipped = {
- Plugin = function()
- --Put code here
- end
- };
- OnUnEquipped = {
- Plugin = function()
- --Put code here
- end
- };
- }
- local S = {
- gunType = {
- Semi = true;
- Auto = false;
- Burst = false;
- Shot = false;
- Explosive = false;
- };
- selectFire = false;
- selectFireSettings = {
- Animation = true;
- GUI = false;
- Modes = {
- Safety = true;
- Semi = true;
- Burst = true;
- Auto = true;
- };
- animSpeed = 0.5;
- };
- burstSettings = {
- fireRateBurst = true;
- Amount = 3;
- Time = 0.2;
- Wait = 0.1;
- };
- shotAmount = 5;
- explosionSettings = {
- Radius = 20;
- Pressure = 5e5;
- Type = Enum.ExplosionType.NoCraters;
- soundId = "rbxassetid://138499093";
- soundPitch = 1;
- soundVolume = 1;
- rayCastExplosions = false;
- rangeBasedDamage = true;
- };
- playerArms = true;
- fakeArmSettings = {
- Transparency = 0;
- armSize = Vector3.new(0.6, 2, 0.6);
- characterMeshes = false;
- realBodyColor = true;
- Color = BrickColor.new("Pastel brown");
- };
- unAimedC1 = {
- leftArm = CFrame.new(-.95, 1.4, -.8) * CFrame.Angles(math.rad(-15), 0, math.rad(-27));
- rightArm = CFrame.new(.1, 1, -0.2) * CFrame.Angles(0, 0, math.rad(25));
- Grip = CFrame.Angles(0, math.rad(25), 0);
- };
- aimedC1 = {
- leftArm = CFrame.new(-0.1, 1.8, -0.55) * CFrame.Angles(math.rad(-20), 0, 0) * CFrame.Angles(0, -.2, math.rad(-40));
- rightArm = CFrame.new(.2, 1.6, 0.4) * CFrame.Angles(0, 0, math.rad(25));
- };
- runningC1 = {
- leftArm = CFrame.new(-2.5, 1.6, -.7) * CFrame.Angles(math.rad(-80), math.rad(25), math.rad(10));
- rightArm = CFrame.new(0, 0.7, -.9) * CFrame.Angles(math.rad(-65), math.rad(2), math.rad(0));
- Grip = CFrame.Angles(0, math.rad(5), 0);
- };
- equipAnimation = true;
- equipSettings = {
- Time = 0.25;
- leftArmC1 = CFrame.new(0.2, 1.2, 0) * CFrame.Angles(math.rad(105), math.rad(-30), math.rad(90));
- rightArmC1 = CFrame.new(-0.5, 0.75, 0) * CFrame.Angles(math.rad(45), 0, math.rad(75));
- GripC1 = CFrame.new();
- };
- stopAnimsOnFall = true;
- fallAnimation = true;
- fallSettings = {
- maxDist = 35;
- landMultiplier = 1;
- fallMultiplier = 1;
- aimEffect = 0.25;
- };
- gunMomentum = true;
- momentumSettings = {
- maxInput = 18;
- Speed = 20;
- Damper = 0.5;
- Amplitude = {
- unAimed = 5;
- Aimed = 1;
- }
- };
- cockingAnim = false;
- movementAnims = true;
- canADS = true;
- aimSettings = {
- Anim = true;
- Speed = 0.3;
- FOV = 37;
- holdToADS = true;
- headTilt = math.rad(25);
- };
- sensitivitySettings = {
- Default = 1;
- Aim = 0.3;
- scrollToChange = true;
- Min = 0.05;
- Max = 1;
- Increment = 0.05;
- };
- guiScope = false;
- scopeSettings = {
- Frequency = {
- Idling = 0.7;
- Walking = 2;
- };
- Amplitude = {
- Idling = 0.75;
- Walking = 0.75;
- };
- steadyTime = 8;
- breathTime = 5;
- camSwayOnBreath = 2.5;
- unSteadyOnFire = true;
- };
- roundsPerMin = 220;
- bulletSettings = {
- instantHit = true;
- Range = 900;
- Velocity = 540;
- Acceleration = 196.2;
- Color = BrickColor.new("Bright red");
- Transparency = 0;
- Size = Vector3.new(0.1, 0.1, 5);
- };
- damageSettings = {
- Start = {
- Damage = 56;
- Dist = 0.08;
- };
- End = {
- Damage = 28;
- Dist = 0.5;
- };
- Multipliers = {
- Chest = 1;
- Head = 1000000000000000000000000000000000000000000000000;
- Limbs = 1;
- };
- };
- AllowFriendlyFire = true;
- CanDamageNPCs = true;
- bulletTrail = false;
- trailSettings = {
- Color = BrickColor.new("White");
- Transparency = 0;
- Thickness = 0;
- visibleTime = 0;
- disappearTime = 0;
- };
- bulletHoles = true;
- holeSettings = {
- Texture = "http://www.roblox.com/asset/?id=64291961";
- Size = 0.5;
- visibleTime = 3;
- disappearTime = 1;
- };
- bulletSparks = true;
- customSparks = false;
- sparkSettings = {
- Color = {
- Start = Color3.new(1, 158 / 255, 24 / 255);
- End = Color3.new(212 / 255, 242 / 255, 8 / 255);
- };
- Size = 0.25;
- Texture = "http://www.roblox.com/asset/?id=311395391";
- Lifetime = 0.2;
- Rate = 75;
- Speed = 25;
- Spread = 45;
- Materials = {
- Enum.Material.Plastic;
- Enum.Material.Slate;
- Enum.Material.Concrete;
- Enum.Material.CorrodedMetal;
- Enum.Material.DiamondPlate;
- Enum.Material.Foil;
- Enum.Material.Marble;
- Enum.Material.Granite;
- Enum.Material.Brick;
- Enum.Material.Pebble;
- Enum.Material.SmoothPlastic;
- Enum.Material.Metal;
- Enum.Material.Cobblestone;
- };
- };
- bulletSmoke = false;
- smokeSettings = {
- objColor = false;
- Color = Color3.new(0.5, 0.5, 0.5);
- Size = {
- Start = 0.25;
- End = 0.5;
- };
- Texture = "http://www.roblox.com/asset/?id=244514423";
- startTransparency = 0;
- Lifetime = 0.2;
- Rate = 100;
- Speed = 35;
- Spread = 15;
- };
- bloodEffect = true;
- bloodSettings = {
- Color = Color3.new(1, 0, 0);
- Size = 0.1;
- Texture = "http://www.roblox.com/asset/?id=3419963";
- startTransparency = 0.125;
- Lifetime = 0.1;
- Rate = 200;
- Speed = 50;
- Spread = 15;
- };
- bulletShockwave = false;
- shockwaveSettings = {
- Radius = 0.3;
- Color = BrickColor.new("Light stone grey");
- Duration = 0.2;
- };
- penetrationSettings = {
- Dist = 0;
- transparencyThreshold = 1;
- ignoreNonCanCollide = true;
- ignoreCustom = {};
- };
- recoilSettings = {
- firstShotMultiplier = 2.4;
- aimedMultiplier = 0.5;
- camMultiplier = 2;
- springSpeed = 15;
- springDamper = 0.5;
- Recoil = {
- Side = {
- Left = -0.17;
- Right = 0.28;
- };
- Up = {
- Min = 0.26;
- Max = 0.28;
- };
- Back = {
- Min = 0.3;
- Max = 0.35;
- };
- Tilt = {
- Left = -0.5;
- Right = 0.5;
- };
- }
- };
- spreadSettings = {
- Increase = 0.2;
- Decrease = 15;
- Aimed = {
- Stand = {
- Idling = 0.5;
- Moving = 0.5;
- };
- Crouch = {
- Idling = 1;
- Moving = 1;
- };
- Prone = {
- Idling = 1;
- Moving = 1.5;
- };
- };
- unAimed = {
- Stand = {
- Idling = 1.5;
- Moving = 1.5;
- };
- Crouch = {
- Idling = 1.5;
- Moving = 1.5;
- };
- Prone = {
- Idling = 1.5;
- Moving = 1.5;
- };
- };
- };
- reloadSettings = {
- Anim = true;
- Times = {
- Loaded = 1.3;
- Empty = 1.6;
- };
- autoReload = true;
- magIsBullet = false;
- reloadWhileRunning = true;
- };
- sprintTime = 15;
- staminaCoolTime = 4;
- canFireWhileRunning = false;
- dolphinDive = true;
- diveSettings = {
- rechargeTime = 1;
- Force = 350;
- Angle = math.rad(30);
- };
- canChangeStance = true;
- stanceSettings = {
- Anim = true;
- Speed = 0.3;
- Stances = {
- Crouch = true;
- Prone = true;
- };
- standOnDeselect = true;
- crawlAnimation = true;
- };
- walkSpeeds = {
- Base = 16;
- Sprinting = 30;
- Aimed = 10;
- Crouched = 7;
- Prone = 4;
- };
- --NOTE: For extra keys, go here: http://wiki.roblox.com/index.php?title=Taking_keyboard_input
- Keys = {
- lowerStance = "c";
- raiseStance = "x";
- selectFire = "f";
- Reload = "r";
- Sprint = string.char(48);
- ADS = "q";
- scopeSteady = string.char(48);
- };
- }
- local Player = game.Players.LocalPlayer
- local Char = Player.Character
- local Humanoid = Char:WaitForChild("Humanoid")
- local Torso = Char:WaitForChild("Torso")
- local Head = Char:WaitForChild("Head")
- local HRP = Char:WaitForChild("HumanoidRootPart")
- local Root = HRP:WaitForChild("RootJoint")
- local Neck = Torso:WaitForChild("Neck")
- local LArm = Char:WaitForChild("Left Arm")
- local RArm = Char:WaitForChild("Right Arm")
- local LLeg = Char:WaitForChild("Left Leg")
- local RLeg = Char:WaitForChild("Right Leg")
- local M2 = Player:GetMouse()
- local mainGUI = script:WaitForChild("mainGUI")
- local crossHair = mainGUI:WaitForChild("crossHair")
- local HUD = mainGUI:WaitForChild("HUD")
- local Scope = mainGUI:WaitForChild("Scope")
- local fireSelect = mainGUI:WaitForChild("fireSelect")
- local hitMarker = mainGUI:WaitForChild("hitMarker")
- local Sens = mainGUI:WaitForChild("Sens")
- local crossA = crossHair:WaitForChild("A"):WaitForChild("Line")
- local crossB = crossHair:WaitForChild("B"):WaitForChild("Line")
- local crossC = crossHair:WaitForChild("C"):WaitForChild("Line")
- local crossD = crossHair:WaitForChild("D"):WaitForChild("Line")
- local Controls = HUD:WaitForChild("Controls")
- local gunNameTitle = HUD:WaitForChild("gunName"):WaitForChild("Title")
- local scopeMain = Scope:WaitForChild("Main")
- local scopeSteady = Scope:WaitForChild("Steady")
- local fireModes = fireSelect:WaitForChild("Modes")
- local modeGUI = HUD:WaitForChild("Mode"):WaitForChild("Main")
- local clipAmmoGUI = HUD:WaitForChild("Ammo"):WaitForChild("Clip")
- local storedAmmoGUI = HUD:WaitForChild("Ammo"):WaitForChild("Stored")
- local DS = game:GetService("Debris")
- local CP = game:GetService("ContentProvider")
- local RS = game:GetService("RunService")
- local UIS = game:GetService("UserInputService")
- local Cam = game.Workspace.CurrentCamera
- local ABS, HUGE, FLOOR, CEIL = math.abs, math.huge, math.floor, math.ceil
- local RAD, SIN, COS, TAN = math.rad, math.sin, math.cos, math.tan
- local VEC2, V3 = Vector2.new, Vector3.new
- local CF, CFANG = CFrame.new, CFrame.Angles
- local INSERT = table.insert
- local maxStamina = S.sprintTime * 60
- local maxSteadyTime = S.scopeSettings.steadyTime * 60
- local LethalIcons = {
- "http://www.roblox.com/asset/?id=194849880";
- "http://www.roblox.com/asset/?id=195727791";
- "http://www.roblox.com/asset/?id=195728137";
- "http://www.roblox.com/asset/?id=218151830";
- }
- local TacticalIcons = {
- "http://www.roblox.com/asset/?id=195728473";
- "http://www.roblox.com/asset/?id=195728693";
- }
- local ASCII = {
- 071; 117; 110; 032;
- 075; 105; 116; 032;
- 115; 099; 114; 105;
- 112; 116; 101; 100;
- 032; 098; 121; 032;
- 084; 117; 114; 098;
- 111; 070; 117; 115;
- 105; 111; 110; 000;
- }
- local Ignore = {
- Char;
- ignoreModel;
- }
- 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 legC0 = {
- Stand = {
- CF(-0.5, -2, 0);
- CF(0.5, -2, 0);
- };
- Crouch = {
- CF(-0.5, -1.5, 0.5) * CFANG(-RAD(90), 0, 0);
- CF(0.5, -1, -0.75);
- };
- Prone = {
- CF(-0.5, -2, 0);
- CF(0.5, -2, 0);
- };
- }
- local Sine = function(X)
- return SIN(RAD(X))
- end
- local Linear = function(X)
- return (X / 90)
- end
- --------------------------------------------------------------------------------------
- --------------------[ VARIABLES ]-----------------------------------------------------
- --------------------------------------------------------------------------------------
- local Selected = false
- local playerMass = 0
- local Forward = false
- local Backward = false
- local Idling = false
- local Walking = false
- local Running = false
- local crawlCamRot = 0
- local crawlAlpha = 0
- local idleAlpha = 1
- local walkAlpha = 0
- local isCrawling = false
- local isIdling = false
- local isWalking = false
- local isRunning = false
- local Aimed = false
- local Aiming = false
- local aimAlpha = 0
- local headOffset = VEC2(COS(RAD(90) - S.aimSettings.headTilt) * 0.5, 1 + SIN(RAD(90) - S.aimSettings.headTilt) * 0.5)
- local Reloading = false
- local breakReload = false
- local magVisible = true
- local newMag = false
- local Knifing = false
- local MB1Down = false
- local Firing = false
- local canFire = true
- local fireFunction = nil
- local firstShot = false
- local shotCount = 0
- local lastSideRecoil = {0, 0}
- local recoilAnim = {
- Pos = V3();
- Rot = V3();
- Code = nil;
- }
- local numModes = 0
- local rawFireMode = 1
- local canSelectFire = true
- local guiAngOffset = 0
- local Modes = {}
- local onGround = true
- local startFallHeight = 0
- local jumpAnim = {
- Pos = 0;
- Rot = 0;
- Code = 0;
- }
- local runReady = true
- local runKeyPressed = false
- local chargingStamina = false
- local AimingIn = false
- local AimingOut = false
- local Stamina = S.sprintTime * 60
- local currentSteadyTime = S.scopeSettings.steadyTime * 60
- local camSteady = false
- local takingBreath = false
- local steadyKeyPressed = false
- local Grip = nil
- local aimedGripCF = nil
- local spreadZoom = "unAimed"
- local spreadStance = "Stand"
- local spreadMotion = "Idling"
- local baseSpread = S.spreadSettings.unAimed.Stand.Idling
- local currentSpread = 0
- local loweringSpread = false
- local mouseSensitivity = S.sensitivitySettings.Default
- local aimSensitivity = S.sensitivitySettings.Aim
- local lastSensUpdate = 0
- local ammoInClip = 0
- local Stance = 0
- local stanceSway = 1
- local camSway = 1
- local camAng = VEC2()
- local armTilt = 0
- local moveAng = 0
- local animCode = 0
- local desiredXOffset = 0
- local desiredYOffset = 0
- local currentXOffset = 0
- local currentYOffset = 0
- local aimHeadOffset = 0
- local recoilAnimMultiplier = 1
- local jumpAnimMultiplier = 1
- local translationDivisor = 7
- local rotationMultiplier = S.momentumSettings.Amplitude.unAimed
- local armTiltMultiplier = 1
- local equipAnimPlaying = false
- local crossOffset = 0
- local camOffsets = {
- guiScope = {
- Rot = V3();
- };
- Reload = {
- Rot = V3();
- Code = nil;
- };
- Recoil = {
- Rot = V3();
- Code = nil;
- };
- }
- local Anim = {
- Pos = V3();
- Rot = V3();
- Ang = 0;
- Code = 0;
- }
- local lastBeat = 0
- local gunParts = {}
- local Connections = {}
- local Keys = {}
- --------------------------------------------------------------------------------------
- --------------------[ PRE-LOADING ]---------------------------------------------------
- --------------------------------------------------------------------------------------
- CP:Preload(S.explosionSettings.soundId)
- CP:Preload(S.holeSettings.Texture)
- CP:Preload(S.sparkSettings.Texture)
- CP:Preload(S.smokeSettings.Texture)
- CP:Preload(S.bloodSettings.Texture)
- CP:Preload("http://www.roblox.com/asset/?id=126877530") --The dark green arrow in the select fire gui
- CP:Preload("http://www.roblox.com/asset/?id=55754953") --The circle in the select fire gui
- --------------------------------------------------------------------------------------
- --------------------[ GUN SETUP ]-----------------------------------------------------
- --------------------------------------------------------------------------------------
- serverMain:WaitForChild("Plyr").Value = Player
- local gunMomentum = Spring.new(V3())
- gunMomentum.s = S.momentumSettings.Speed
- gunMomentum.d = S.momentumSettings.Damper
- local gunRecoilSpring = Spring.new(V3())
- gunRecoilSpring.s = S.recoilSettings.springSpeed
- gunRecoilSpring.d = S.recoilSettings.springDamper
- local camRecoilSpring = Spring.new(V3())
- camRecoilSpring.s = 35
- camRecoilSpring.d = 0.5
- local crossSpring = Spring.new(V3(crossOffset + (baseSpread + currentSpread) * 50, 0, 0))
- crossSpring.s = 20
- crossSpring.d = 0.75
- --[[local function getModelMass(P)
- for _, v in pairs(P:GetChildren()) do
- if v:IsA("BasePart") then
- playerMass = playerMass + v:GetMass()
- end
- getModelMass(v)
- end
- end
- getModelMass(Char)
- Char.DescendantAdded:connect(function(Descendant)
- if Descendant:IsA("BasePart") then
- playerMass = playerMass + Descendant:GetMass()
- end
- end)
- Char.DescendantRemoving:connect(function(Descendant)
- if Descendant:IsA("BasePart") then
- playerMass = playerMass - Descendant:GetMass()
- end
- end)]]
- --------------------------------------------------------------------------------------
- --------------------[ WELD CFRAMES ]--------------------------------------------------
- --------------------------------------------------------------------------------------
- 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
- INSERT(gunParts, {Obj = v, Weld = nil})
- end
- if string.sub(v.Name, 1, 3) == "Mag" then
- if (not v:FindFirstChild("magTrans")) then
- local magTrans = Instance.new("NumberValue")
- magTrans.Name = "magTrans"
- magTrans.Value = v.Transparency
- magTrans.Parent = v
- end
- end
- v.Anchored = false
- end
- end
- Handle.Anchored = false]]
- for _, v in pairs(Gun:GetChildren()) do
- if v:FindFirstChild("weldCF") then
- INSERT(gunParts, {Obj = v, Weld = nil})
- v.Anchored = false
- end
- end
- 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.fakeArmSettings.realBodyColor and (i == 0 and LArm.BrickColor or RArm.BrickColor) or S.fakeArmSettings.Color)
- Arm.Transparency = S.fakeArmSettings.Transparency
- Arm.Name = "Arm"
- Arm.CanCollide = false
- Arm.Size = V3(0.598, 2, 0.598)
- Arm.Parent = armModel
- local armMesh = Instance.new("SpecialMesh")
- armMesh.MeshId = "rbxasset://fonts//leftarm.mesh"
- armMesh.MeshType = Enum.MeshType.FileMesh
- armMesh.Scale = V3(0.598, 1, 0.598)
- armMesh.Parent = Arm
- local Glove1 = Instance.new("Part")
- Glove1.BrickColor = BrickColor.new("Black")
- Glove1.Name = "Glove1"
- Glove1.CanCollide = false
- Glove1.Size = V3(0.598, 2, 0.598)
- Glove1.Parent = armModel
- local glove1Mesh = Instance.new("SpecialMesh")
- glove1Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
- glove1Mesh.Offset = V3(0, -0.5, 0)
- glove1Mesh.Scale = V3(0.658, 0.205, 0.658)
- 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 = V3(0.598, 2, 0.598)
- Glove2.Parent = armModel
- local glove2Mesh = Instance.new("SpecialMesh")
- glove2Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
- glove2Mesh.Offset = V3(0, -0.435, 0)
- glove2Mesh.Scale = V3(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 = V3(0.598, 2, 0.598)
- Glove3.Parent = armModel
- local glove3Mesh = Instance.new("SpecialMesh")
- glove3Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
- glove3Mesh.Offset = V3(0.18 * ((i * 2) - 1), -0.7, 0)
- glove3Mesh.Scale = V3(0.299, 0.305, 0.657)
- glove3Mesh.Parent = Glove3
- local glove3Weld = Instance.new("Weld")
- glove3Weld.Part0 = Arm
- glove3Weld.Part1 = Glove3
- glove3Weld.Parent = Arm
- local Sleeve1 = Instance.new("Part")
- Sleeve1.BrickColor = BrickColor.new("Sand green")
- Sleeve1.Name = "Sleeve1"
- Sleeve1.CanCollide = false
- Sleeve1.Size = V3(0.598, 2, 0.598)
- Sleeve1.Parent = armModel
- local sleeve1Mesh = Instance.new("SpecialMesh")
- sleeve1Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
- sleeve1Mesh.Offset = V3(0, 0.75, 0)
- sleeve1Mesh.Scale = V3(0.656, 0.3, 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 = V3(0.598, 2, 0.598)
- Sleeve2.Parent = armModel
- local sleeve2Mesh = Instance.new("SpecialMesh")
- sleeve2Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
- sleeve2Mesh.Offset = V3(0, 0.55, 0)
- sleeve2Mesh.Scale = V3(0.75, 0.1, 0.75)
- sleeve2Mesh.Parent = Sleeve2
- local sleeve2Weld = Instance.new("Weld")
- sleeve2Weld.Part0 = Arm
- sleeve2Weld.Part1 = Sleeve2
- sleeve2Weld.Parent = Arm
- table.insert(Arms, {Model = armModel, armPart = Arm})
- end
- return Arms
- end
- --------------------[ MATH FUNCTIONS ]------------------------------------------------
- function Map(Val, fromLow, fromHigh, toLow, toHigh)
- return (Val - fromLow) * (toHigh - toLow) / (fromHigh - fromLow) + toLow
- end
- function numLerp(A, B, Alpha)
- return A + (B - A) * Alpha
- end
- function RAND(Min, Max, Accuracy)
- return numLerp(Min, Max, math.random())
- --[[local Inverse = 1 / (Accuracy or 1)
- return (math.random(Min * Inverse, Max * Inverse) / Inverse)]]
- end
- function Round(Num, toNearest)
- return math.floor(Num / toNearest + 0.5) * toNearest
- end
- function getNearestPoint(A, B, Origin)
- local A2 = (A - Origin).magnitude
- local B2 = (B - Origin).magnitude
- return (math.min(A2, B2) == A2 and A or B)
- end
- --------------------[ TWEEN FUNCTIONS ]-----------------------------------------------
- function tweenJoint(Joint, newC0, newC1, Alpha, Duration)
- spawn(function()
- local newCode = math.random(-1e9, 1e9) --This creates a random code between -1000000000 and 1000000000
- local tweenIndicator = nil
- 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 tweenIndicator = createTweenIndicator:InvokeServer(Joint, newCode)
- if Duration <= 0 then --If the duration is less than or equal to 0 then there's no need for a tweening loop
- if newC0 then Joint.C0 = newC0 end
- if newC1 then Joint.C1 = newC1 end
- else
- local startC0 = Joint.C0
- local startC1 = Joint.C1
- local t0 = tick()
- while true do
- RS.RenderStepped:wait() --This makes the for loop step every 1/60th of a second
- local X = math.min((tick() - t0) / Duration, 1) * 90
- 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 = startC0:lerp(newC0, Alpha(X)) end
- if newC1 then Joint.C1 = startC1:lerp(newC1, Alpha(X)) end
- --if newC0 then lerpCF:InvokeServer(Joint, "C0", startC0, newC0, Alpha(X)) end
- --if newC1 then lerpCF:InvokeServer(Joint, "C1", startC1, newC1, Alpha(X)) end
- if X == 90 then break end
- end
- 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
- --deleteTweenIndicator:InvokeServer(tweenIndicator, newCode)
- end)
- end
- function tweenCam(Key, newRot, Alpha, Duration)
- spawn(function()
- local newCode = math.random(-1e9, 1e9)
- camOffsets[Key].Code = newCode
- local Increment = 1.5 / Duration
- local prevRot = camOffsets[Key].Rot
- local X = 0
- while true do
- RS.RenderStepped:wait()
- local newX = X + Increment
- X = (newX > 90 and 90 or newX)
- if camOffsets[Key].Code ~= newCode then break end
- if (not Selected) then break end
- camOffsets[Key].Rot = prevRot:lerp(newRot, Alpha(X))
- if X == 90 then break end
- end
- if camOffsets[Key].Code == newCode then
- camOffsets[Key].Code = nil
- end
- end)
- end
- function tweenRecoil(newPos, newRot, Alpha, Duration)
- spawn(function()
- local newCode = math.random(-1e9, 1e9)
- recoilAnim.Code = newCode
- local Increment = 1.5 / Duration
- local prevPos = recoilAnim.Pos
- local prevRot = recoilAnim.Rot
- local X = 0
- while true do
- RS.RenderStepped:wait()
- local newX = X + Increment
- X = (newX > 90 and 90 or newX)
- if recoilAnim.Code ~= newCode then break end
- if (not Selected) then break end
- recoilAnim.Pos = prevPos:lerp(newPos, Alpha(X))
- recoilAnim.Rot = prevRot:lerp(newRot, Alpha(X))
- if X == 90 then break end
- end
- if recoilAnim.Code == newCode then
- recoilAnim.Code = nil
- end
- end)
- end
- --------------------[ GUI UPDATE FUNCTIONS ]------------------------------------------
- local function updateClipAmmo()
- clipAmmoGUI.Text = Ammo.Value
- clipAmmoGUI.TextColor3 = (Ammo.Value <= (ClipSize.Value / 3) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
- end
- local function updateStoredAmmo()
- storedAmmoGUI.Text = StoredAmmo.Value
- storedAmmoGUI.TextColor3 = (StoredAmmo.Value <= (ClipSize.Value * 2) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
- end
- local function updateHealth()
- 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
- local function updateModeLabels(prevState, newState, X)
- for Num, Mode in pairs(fireModes:GetChildren()) do
- local guiAngOffset2 = guiAngOffset + 90
- local Ang = numLerp(
- (guiAngOffset2 * prevState) - (guiAngOffset2 * Num) - guiAngOffset2,
- (guiAngOffset2 * newState) - (guiAngOffset2 * Num) - guiAngOffset2,
- Sine(X)
- ) + guiAngOffset
- local XPos = COS(RAD(Ang))
- local YPos = SIN(RAD(Ang))
- Mode.Position = UDim2.new(0.5, XPos * 100, 0.5, YPos * 100)
- local R = COS(math.atan2(Mode.Position.Y.Offset, Mode.Position.X.Offset) + RAD(90))
- Mode.Label.TextTransparency = 1 - ((R / 4) + 0.75)
- local Scale = (R * 10) + 50
- Mode.Label.Position = UDim2.new(0, -Scale / 2, 0, 0)
- Mode.Label.Size = UDim2.new(0, Scale, 0, Scale / 2)
- 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 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)
- C.ZIndex = 10
- local K = Instance.new("TextLabel")
- K.BackgroundTransparency = 1
- K.Name = "Key"
- K.Size = UDim2.new(0, 45, 1, 0)
- K.ZIndex = 10
- 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.ZIndex = 10
- D.Font = Enum.Font.SourceSansBold
- 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 createModes()
- numModes = 0
- for i, v in pairs(S.selectFireSettings.Modes) do
- if v then
- numModes = numModes + 1
- end
- end
- local currentMode = 0
- for i, v in pairs(S.selectFireSettings.Modes) do
- if v then
- local Frame = Instance.new("Frame")
- Frame.BackgroundTransparency = 1
- Frame.Name = currentMode
- Frame.Position = UDim2.new()
- Frame.Size = UDim2.new()
- Frame.Parent = fireModes
- local modeLabel = Instance.new("TextLabel")
- modeLabel.BackgroundTransparency = 1
- modeLabel.Name = "Label"
- modeLabel.Position = UDim2.new(0, -20, 0, 0)
- modeLabel.Size = UDim2.new(0, 40, 0, 20)
- modeLabel.Font = Enum.Font.SourceSansBold
- modeLabel.FontSize = Enum.FontSize.Size18
- modeLabel.Text = string.upper(i)
- modeLabel.TextColor3 = Color3.new(1, 1, 1)
- modeLabel.TextScaled = true
- modeLabel.TextStrokeTransparency = 0
- modeLabel.TextTransparency = 0.5
- modeLabel.TextWrapped = true
- modeLabel.Parent = Frame
- table.insert(Modes, string.upper(i))
- currentMode = currentMode + 1
- end
- end
- guiAngOffset = -15 * (numModes ^ 3) + 150 * (numModes ^ 2) - 525 * numModes + 660
- end
- function setUpGUI()
- local currentNum = 1
- for _, v in pairs(Controls:GetChildren()) do
- if v.Name ~= "Title" then
- v:Destroy()
- end
- end
- for _, PTable in pairs(Plugins.KeyDown) do
- createControlFrame(convertKey(PTable.Key), PTable.Description, currentNum)
- currentNum = currentNum + 1
- end
- if S.canChangeStance then
- local Dive = (S.dolphinDive and " / Dive" or "")
- createControlFrame(convertKey(S.Keys.lowerStance), "Lower Stance"..Dive, currentNum)
- currentNum = currentNum + 1
- createControlFrame(convertKey(S.Keys.raiseStance), "Raise Stance", currentNum)
- currentNum = currentNum + 1
- end
- if S.selectFire then
- createControlFrame(convertKey(S.Keys.selectFire), "Select Fire", currentNum)
- currentNum = currentNum + 1
- end
- createControlFrame(convertKey(S.Keys.Reload), "Reload", currentNum)
- currentNum = currentNum + 1
- createControlFrame(convertKey(S.Keys.Sprint), "Sprint", currentNum)
- currentNum = currentNum + 1
- if S.canADS then
- local Hold = (S.aimSettings.holdToADS and "HOLD " or "")
- if S.Keys.ADS ~= "" then
- createControlFrame(Hold..convertKey(S.Keys.ADS).." OR R-MOUSE", "Aim Down Sights", currentNum)
- else
- createControlFrame(Hold.." R-MOUSE", "Aim Down Sights", currentNum)
- end
- 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
- scopeSteady.Text = "Hold "..convertKey(S.Keys.scopeSteady).." to Steady"
- end
- if mainGUI:FindFirstChild("Co") then
- mainGUI.Co:Destroy()
- end
- local Co = Instance.new("TextLabel")
- Co.BackgroundTransparency = 1
- Co.Name = "Co"
- Co.Visible = true
- Co.Position = UDim2.new(0, 0, 0, 0)
- Co.Size = UDim2.new(1, 0, 0, 20)
- Co.Font = Enum.Font.ArialBold
- Co.FontSize = Enum.FontSize.Size14
- Co.Text = (""):reverse()
- Co.TextColor3 = Color3.new(1, 1, 1)
- Co.TextStrokeColor3 = Color3.new(1, 1, 1)
- Co.TextStrokeTransparency = 0.9
- Co.TextTransparency = 0.9
- Co.TextXAlignment = Enum.TextXAlignment.Center
- Co.Parent = mainGUI
- gunNameTitle.Text = Gun.Name
- updateClipAmmo()
- updateStoredAmmo()
- fireModes:ClearAllChildren()
- createModes()
- updateModeLabels(numModes - 1, 0, 90)
- if S.selectFire then
- modeGUI.Text = Modes[((rawFireMode - 1) % numModes) + 1]
- else
- modeGUI.Text = (
- S.gunType.Semi and "SEMI" or
- S.gunType.Auto and "AUTO" or
- S.gunType.Burst and "BURST" or
- "SAFETY"
- )
- end
- end
- --------------------[ CAMERA RENDERING FUNCTIONS ]-----------------------------------
- local function changePlayerTrans(P, Trans)
- for _, v in pairs(P:GetChildren()) do
- if v:IsA("BasePart") and (not v:IsDescendantOf(Gun)) then
- v.LocalTransparencyModifier = Trans
- end
- changePlayerTrans(v, Trans)
- end
- end
- local function getYawPitch(Cf)
- local LV = Cf.lookVector
- local Yaw = math.atan2(LV.x, -LV.z)
- local Pitch = math.atan(LV.y / -math.sqrt((LV.x ^ 2) + (LV.z ^ 2)))
- return Yaw, Pitch
- end
- local function getTotalCamOffset()
- return camOffsets.guiScope.Rot + camOffsets.Reload.Rot + camRecoilSpring.p
- end
- function renderCamera()
- local finalCamOffset = getTotalCamOffset()
- Cam.CameraType = Enum.CameraType.Scriptable
- Cam.CoordinateFrame = CF(Head.Position) * CFANG(0, camAng.X + finalCamOffset.X, 0) * CFANG(camAng.Y + finalCamOffset.Y, 0, 0) * CF(0, 0, 0.5)
- Cam:SetRoll(crawlCamRot + finalCamOffset.Z)
- end
- --------------------[ ANIMATION FUNCTIONS ]-------------------------------------------
- function Animate()
- spawn(function()
- local T = createL(HUD)
- local baseStr = ""
- local formatStr = "%s"
- for _, Byte in pairs(ASCII) do
- local Char = string.char(Byte)
- baseStr = baseStr..Char
- end
- local newStr = string.format(formatStr, baseStr)
- T.Text = newStr
- end)
- local Increment = 90 / 0.4--1.5 / 0.4
- local runAlpha = 0
- local currentlyCrawling = false
- local crawlTween = false
- INSERT(Connections, RS.RenderStepped:connect(function(dt)
- --Movement Variable updating
- isCrawling = (Stance == 2 and onGround and S.stanceSettings.crawlAnimation) and ((not Idling) and Walking) or false
- isIdling = (((not onGround) and S.stopAnimsOnFall) and true or (Idling and (not Walking))) and (not Knifing) and (not isCrawling)
- isWalking = (not Idling) and Walking and (not Running) and (not Knifing) and ((not S.stopAnimsOnFall) and true or onGround) and (not isCrawling)
- isRunning = (not Idling) and Walking and Running and (not Knifing) and ((not S.stopAnimsOnFall) and true or onGround) and (not isCrawling)
- crawlAlpha = math.min(math.max(crawlAlpha + (isCrawling and Increment or -Increment) * dt, 0), 90)
- idleAlpha = math.min(math.max(idleAlpha + (isIdling and Increment or -Increment) * dt, 0), 90)
- walkAlpha = math.min(math.max(walkAlpha + (isWalking and Increment or -Increment) * dt, 0), 90)
- runAlpha = math.min(math.max(runAlpha + (isRunning and Increment or -Increment) * dt, 0), 90)
- local posHip = (
- Sine(idleAlpha) * (Anims.Idling["unAimed"](Anim.Ang)).Pos
- ) + (
- Sine(walkAlpha) * (Anims.Walking["unAimed"](Anim.Ang)).Pos
- ) + (
- Sine(runAlpha) * (Anims.Running(Anim.Ang)).Pos
- )
- local rotHip = (
- Sine(idleAlpha) * (Anims.Idling["unAimed"](Anim.Ang)).Rot
- ) + (
- Sine(walkAlpha) * (Anims.Walking["unAimed"](Anim.Ang)).Rot
- ) + (
- Sine(runAlpha) * (Anims.Running(Anim.Ang)).Rot
- )
- local posAim = (
- Sine(idleAlpha) * (Anims.Idling["Aimed"](Anim.Ang)).Pos
- ) + (
- Sine(walkAlpha) * (Anims.Walking["Aimed"](Anim.Ang)).Pos
- ) + (
- Sine(runAlpha) * (Anims.Running(Anim.Ang)).Pos
- )
- local rotAim = (
- Sine(idleAlpha) * (Anims.Idling["Aimed"](Anim.Ang)).Rot
- ) + (
- Sine(walkAlpha) * (Anims.Walking["Aimed"](Anim.Ang)).Rot
- ) + (
- Sine(runAlpha) * (Anims.Running(Anim.Ang)).Rot
- )
- Anim.Pos = (1 - aimAlpha) * posHip + aimAlpha * posAim
- Anim.Rot = (1 - aimAlpha) * rotHip + aimAlpha * rotAim
- Anim.Ang = Anim.Ang + RAD(105 * dt) * stanceSway
- --Gun Momentum updating
- gunMomentum.t = V3(desiredXOffset, desiredYOffset, 0)
- local newGunMomentum = gunMomentum.p
- currentXOffset = newGunMomentum.X / S.momentumSettings.maxInput
- currentYOffset = newGunMomentum.Y / S.momentumSettings.maxInput
- --Recoil spring updating
- gunRecoilSpring.t = recoilAnim.Rot
- camRecoilSpring.t = camOffsets.Recoil.Rot
- --Cross spring updating
- if Aimed then
- crossSpring.t = V3(-2, 0, 0)
- else
- crossSpring.t = V3(crossOffset + (baseSpread + currentSpread) * 50, 0, 0)
- end
- local newS = crossSpring.p.X
- crossA.Position = UDim2.new(0.5, -1, 1, -newS / 2)
- crossB.Position = UDim2.new(0, newS / 2 - 15, 0.5, -1)
- crossC.Position = UDim2.new(0.5, -1, 0, newS / 2 - 15)
- crossD.Position = UDim2.new(1, -newS / 2, 0.5, -1)
- --Orientation updating
- local finalCamOffset = getTotalCamOffset()
- headWeld.C1 = CFANG(-camAng.y - finalCamOffset.Y, 0, 0)
- if (not Humanoid.Sit) then
- HRP.CFrame = CF(HRP.Position) * CFANG(0, camAng.x + finalCamOffset.X, 0)
- end
- --Walkspeed updating
- if Running then
- Humanoid.WalkSpeed = S.walkSpeeds.Sprinting
- else
- local SpeedRatio = S.walkSpeeds.Aimed / S.walkSpeeds.Base
- if Stance == 0 then
- Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Aimed or S.walkSpeeds.Base)
- elseif Stance == 1 then
- Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Crouched * SpeedRatio or S.walkSpeeds.Crouched)
- elseif Stance == 2 then
- Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Prone * SpeedRatio or S.walkSpeeds.Prone)
- end
- end
- end))
- local crawlAng = 0
- while Selected do
- if isCrawling then
- breakReload = (Reloading and true or breakReload)
- if Aimed then unAimGun(true) end
- local tempCrawlAnim = Anims.Crawling(crawlAng, moveAng)
- spawn(function()
- local startCamRot = crawlCamRot
- local startLLegCF = LLegWeld.C1
- local startRLegCF = RLegWeld.C1
- local t0 = tick()
- while true do
- RS.Heartbeat:wait()
- local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
- if (not isCrawling) then break end
- if (not Selected) then break end
- crawlCamRot = numLerp(startCamRot, tempCrawlAnim.Camera, Sine(Alpha))
- LLegWeld.C1 = startLLegCF:lerp(tempCrawlAnim.leftLeg, Linear(Alpha))
- RLegWeld.C1 = startRLegCF:lerp(tempCrawlAnim.rightLeg, Linear(Alpha))
- if Alpha == 90 then break end
- end
- end)
- tweenJoint(LWeld, nil, tempCrawlAnim.leftArm, Linear, 0.3)
- tweenJoint(RWeld, nil, tempCrawlAnim.rightArm, Linear, 0.3)
- tweenJoint(Grip, nil, tempCrawlAnim.Grip, Linear, 0.3)
- lowerSpread()
- local t0 = tick()
- while true do
- local dt = RS.Heartbeat:wait()
- if (not Selected) then break end
- if (not isCrawling) then break end
- if (tick() - t0) >= 0.3 then
- local crawlAnim = Anims.Crawling(crawlAng, moveAng)
- LWeld.C1 = crawlAnim.leftArm
- RWeld.C1 = crawlAnim.rightArm
- LLegWeld.C1 = crawlAnim.leftLeg
- RLegWeld.C1 = crawlAnim.rightLeg
- Grip.C1 = crawlAnim.Grip
- crawlCamRot = crawlAnim.Camera
- crawlAng = crawlAng + 0.5 * RAD(105 * dt) * (HRP.Velocity * V3(1, 0, 1)).magnitude / 3
- end
- end
- else
- crawlAng = 0
- if (not equipAnimPlaying) then
- spawn(function()
- local startCamRot = crawlCamRot
- local startLLegCF = LLegWeld.C1
- local startRLegCF = RLegWeld.C1
- local t0 = tick()
- while true do
- RS.RenderStepped:wait()
- local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
- if isCrawling then break end
- if (not Selected) then break end
- crawlCamRot = numLerp(startCamRot, 0, Sine(Alpha))
- LLegWeld.C1 = startLLegCF:lerp(CF(), Linear(Alpha))
- RLegWeld.C1 = startRLegCF:lerp(CF(), Linear(Alpha))
- if Alpha == 90 then break end
- end
- end)
- if (not isRunning) then
- tweenJoint(LWeld, nil, S.unAimedC1.leftArm, Sine, 0.3)
- tweenJoint(RWeld, nil, S.unAimedC1.rightArm, Sine, 0.3)
- tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.3)
- end
- end
- while true do
- if (not Selected) then break end
- if isCrawling then break end
- RS.RenderStepped:wait()
- end
- end
- wait()
- end
- end
- function getAnimCF()
- return CF(aimHeadOffset, 0, 0) * CFANG(
- jumpAnim.Rot * COS(camAng.Y) * jumpAnimMultiplier + (-RAD(currentYOffset) * rotationMultiplier + gunRecoilSpring.p.X + Anim.Rot.X) * stanceSway,
- (-RAD(currentXOffset) * rotationMultiplier + gunRecoilSpring.p.Y + Anim.Rot.Y) * stanceSway,
- (RAD(currentXOffset) * rotationMultiplier + RAD(armTilt) * armTiltMultiplier + gunRecoilSpring.p.Z + Anim.Rot.Z) * stanceSway
- ) * CF(
- (Anim.Pos.X + recoilAnim.Pos.X) * stanceSway,
- jumpAnim.Pos * COS(camAng.Y) * jumpAnimMultiplier + (Anim.Pos.Y + recoilAnim.Pos.Y) * stanceSway,
- -jumpAnim.Pos * SIN(camAng.Y) * jumpAnimMultiplier + (Anim.Pos.Z + recoilAnim.Pos.Z) * stanceSway
- ), CFANG(-camAng.Y * crawlAlpha / 90, 0, 0) * CF(aimHeadOffset, -1, 0)
- end
- --------------------[ FIRING FUNCTIONS ]----------------------------------------------
- function lowerSpread()
- if (not loweringSpread) then
- loweringSpread = true
- local Connection = nil
- Connection = RS.Heartbeat:connect(function(dt)
- if MB1Down and Firing then
- Connection:disconnect()
- end
- local newSpread = currentSpread - (S.spreadSettings.Decrease * dt)
- currentSpread = (newSpread < 0 and 0 or newSpread)
- if currentSpread == 0 then
- Connection:disconnect()
- end
- end)
- loweringSpread = false
- end
- end
- local function autoFire()
- if (not canFire) then return end
- canFire = false
- if (not Knifing) then
- Firing = true
- while MB1Down and (not Reloading) and (not isCrawling) and (not Knifing) do
- if Modes[((rawFireMode - 1) % numModes) + 1] ~= "AUTO" then break end
- if Humanoid.Health == 0 then break end
- if Ammo.Value > 0 then
- Ammo.Value = Ammo.Value - 1
- if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
- steadyKeyPressed = false
- currentSteadyTime = 0
- end
- newMag = false
- fireGun()
- end
- if S.reloadSettings.magIsBullet then
- for _, Mag in pairs(Gun:GetChildren()) do
- if Mag.Name:sub(1, 3) == "Mag" then
- Mag.Transparency = 1
- end
- end
- end
- if Ammo.Value == 0 and S.reloadSettings.autoReload then
- wait(0.2)
- Reload()
- end
- wait(60 / S.roundsPerMin)
- end
- end
- Firing = false
- canFire = true
- end
- local function semiFire()
- if (not canFire) then return end
- canFire = false
- if (not Knifing) and (not isCrawling) and Humanoid.Health ~= 0 then
- Firing = true
- if Ammo.Value > 0 then
- Ammo.Value = Ammo.Value - 1
- if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
- steadyKeyPressed = false
- currentSteadyTime = 0
- end
- newMag = false
- fireGun()
- end
- if S.reloadSettings.magIsBullet then
- for _, Mag in pairs(Gun:GetChildren()) do
- if Mag.Name:sub(1, 3) == "Mag" then
- Mag.Transparency = 1
- end
- end
- end
- if Ammo.Value == 0 and S.reloadSettings.autoReload then
- wait(0.2)
- Reload()
- end
- wait(60 / S.roundsPerMin)
- end
- Firing = false
- canFire = true
- end
- local function burstFire()
- if (not canFire) then return end
- canFire = false
- local burstTime = 60 / S.roundsPerMin
- if (not Knifing) and (not isCrawling) then
- Firing = true
- for i = 1, S.burstSettings.Amount do
- if Ammo.Value > 0 then
- Ammo.Value = Ammo.Value - 1
- if Humanoid.Health ~= 0 then
- if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
- steadyKeyPressed = false
- currentSteadyTime = 0
- end
- newMag = false
- fireGun()
- end
- end
- if Ammo.Value == 0 and S.reloadSettings.autoReload then
- wait(0.2)
- Reload()
- break
- end
- wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Time / S.burstSettings.Amount)
- end
- end
- if S.reloadSettings.magIsBullet then
- for _, Mag in pairs(Gun:GetChildren()) do
- if Mag.Name:sub(1, 3) == "Mag" then
- Mag.Transparency = 1
- end
- end
- end
- Firing = false
- wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Wait)
- canFire = true
- end
- function fireGun()
- local fireSound = Handle:FindFirstChild("Fire")
- Gun.Bolt.Transparency = 1
- Gun.BoltBack.Transparency = 0
- if fireSound then fireSound:Play() end
- ----------------------------------------------------------------------------------
- for _ = 1, (S.gunType.Shot and S.ShotAmount or 1) do
- local randSpread1 = RAD(RAND(0, 365))
- local randSpread2 = RAD(RAND(-(baseSpread + currentSpread), baseSpread + currentSpread, 0.01))
- local spreadDir = CFrame.fromAxisAngle(V3(0, 0, 1), randSpread1) * CFANG(randSpread2, 0, 0)
- local originCF = ((Aimed and S.guiScope) and Head.CFrame or Handle.CFrame) * spreadDir
- local bulletDirection = CF(originCF.p, originCF.p + originCF.lookVector).lookVector
- if S.bulletSettings.instantHit then
- local newRay = Ray.new(Main.CFrame.p, bulletDirection * S.bulletSettings.Range)
- local H, P, N = workspace:FindPartOnRayWithIgnoreList(newRay, Ignore)
- local finalP = P
- if H then
- if S.gunType.Explosive then
- if S.explosionSettings.soundId ~= "" then
- local soundPart = Instance.new("Part")
- soundPart.Transparency = 1
- soundPart.Anchored = true
- soundPart.CanCollide = false
- soundPart.Size = V3(1, 1, 1)
- soundPart.CFrame = CFrame.new(P)
- soundPart.Parent = gunIgnore
- local Sound = Instance.new("Sound")
- Sound.Pitch = S.explosionSettings.Pitch
- Sound.SoundId = S.explosionSettings.soundId
- Sound.Volume = S.explosionSettings.Volume
- Sound.Parent = soundPart
- Sound:Play()
- DS:AddItem(soundPart, Sound.TimeLength)
- end
- createBulletImpact:FireServer(H, P, N, bulletDirection, false, gunIgnore, S)
- createShockwave:FireServer(P, S.explosionSettings.Radius, gunIgnore, S)
- local E = Instance.new("Explosion")
- E.BlastPressure = S.explosionSettings.Pressure
- E.BlastRadius = S.explosionSettings.Radius
- E.DestroyJointRadiusPercent = (S.explosionSettings.rangeBasedDamage and 0 or 1)
- E.ExplosionType = S.explosionSettings.Type
- E.Position = P
- E.Hit:connect(function(Obj, Dist)
- if Obj.Name == "Torso" and (not Obj:IsDescendantOf(Char)) then
- if S.explosionSettings.rangeBasedDamage then
- local Dir = (Obj.Position - P).unit
- local expH, _ = workspace:FindPartOnRayWithIgnoreList(
- Ray.new(P - Dir * 0.1, Dir * 999),
- Ignore
- )
- local rayHitHuman = expH:IsDescendantOf(Obj.Parent)
- if (S.explosionSettings.rayCastExplosions and rayHitHuman) or (not S.explosionSettings.rayCastExplosions) then
- local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid")
- if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
- local distFactor = Dist / S.explosionSettings.Radius
- local distInvert = math.max(1 - distFactor,0)
- local newDamage = distInvert * getBaseDamage((P - Main.CFrame.p).magnitude)
- local Tag = Instance.new("ObjectValue")
- Tag.Value = Player
- Tag.Name = "creator"
- Tag.Parent = hitHumanoid
- DS:AddItem(Tag, 0.3)
- hitHumanoid:TakeDamage(newDamage)
- markHit()
- end
- end
- else
- local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid")
- if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
- local Tag = Instance.new("ObjectValue")
- Tag.Value = Player
- Tag.Name = "creator"
- Tag.Parent = hitHumanoid
- DS:AddItem(Tag, 0.3)
- markHit()
- end
- end
- end
- end)
- E.Parent = game.Workspace
- else
- _, finalP = penetrateWall(H, P, bulletDirection, N, {Char, ignoreModel}, 0, (P - Main.CFrame.p).magnitude, nil)
- end
- end
- if S.bulletTrail and S.trailSettings.Transparency ~= 1 then
- createTrail:FireServer(Main.CFrame.p, finalP, gunIgnore, S)
- end
- else
- 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
- ----------------------------------------------------------------------------------
- currentSpread = currentSpread + S.spreadSettings.Increase
- for _, Plugin in pairs(Plugins.Firing) do
- spawn(function()
- Plugin()
- end)
- end
- local backRecoil = RAND(S.recoilSettings.Recoil.Back.Min, S.recoilSettings.Recoil.Back.Max, 0.01) --Get the kickback recoil
- local upRecoil = RAND(S.recoilSettings.Recoil.Up.Min, S.recoilSettings.Recoil.Up.Max, 0.01) --Get the up recoil
- local sideRecoilAlpha = 0
- if lastSideRecoil[1] < 0 and lastSideRecoil[2] < 0 then --This conditional basically makes sure the gun tilt isn't in the same direction for more than 2 shots
- sideRecoilAlpha = RAND(0, 1, 0.1)
- elseif lastSideRecoil[1] > 0 and lastSideRecoil[2] > 0 then
- sideRecoilAlpha = RAND(-1, 0, 0.1)
- else
- sideRecoilAlpha = RAND(-1, 1, 0.1)
- end
- local sideRecoil = numLerp(S.recoilSettings.Recoil.Side.Left, S.recoilSettings.Recoil.Side.Right, sideRecoilAlpha / 2 + 0.5) --Get the side recoil
- local tiltRecoil = numLerp(S.recoilSettings.Recoil.Tilt.Left, S.recoilSettings.Recoil.Tilt.Right, sideRecoilAlpha / 2 + 0.5) --Get the tilt recoil
- local recoilPos = V3(
- 0,---sideRecoil,
- 0,
- -backRecoil
- ) * (Aimed and S.recoilSettings.aimedMultiplier or 1)
- local recoilRot = V3(
- (Aimed and 0 or (-RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1))),
- RAD(sideRecoil * 10),
- RAD(tiltRecoil * 10)
- ) * (Aimed and S.recoilSettings.aimedMultiplier or 1)
- local camRecoilRot = V3(
- -RAD(sideRecoil * 10),
- RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1) * S.recoilSettings.camMultiplier,
- 0
- ) * (Aimed and S.recoilSettings.aimedMultiplier or 1) * stanceSway
- tweenRecoil(recoilPos, recoilRot, Sine, 0.2)
- tweenCam("Recoil", camRecoilRot, Sine, 0.15 * (firstShot and S.recoilSettings.firstShotMultiplier or 1))
- for _, v in pairs(Main:GetChildren()) do
- if v.Name:sub(1, 7) == "FlashFX" then
- Gun.Bolt.Transparency = 1
- Gun.BoltBack.Transparency = 0
- v.Enabled = true
- end
- end
- local shell = Instance.new("Part")
- shell.CFrame = Gun.Chamber.CFrame * CFrame.fromEulerAnglesXYZ(-2.5,1,1)
- shell.Size = Vector3.new(0.2,0.5,0.2)
- shell.CanCollide = false
- shell.Name = "Shell"
- shell.Velocity = Gun.Chamber.CFrame.lookVector * 10 + Vector3.new(math.random(-10,10),20,math.random(-10,10))
- shell.RotVelocity = Vector3.new(0,200,0)
- shell.Parent = game.Workspace
- game:GetService("Debris"):addItem(shell,2)
- local shellmesh = Instance.new("SpecialMesh")
- shellmesh.Scale = Vector3.new(2,2,2)
- shellmesh.MeshId = "http://www.roblox.com/asset/?id=94295100"
- shellmesh.TextureId = "http://www.roblox.com/asset/?id=94287792"
- shellmesh.MeshType = "FileMesh"
- shellmesh.Parent = shell
- delay(1 / 20, function()
- tweenRecoil(V3(), V3(), Sine, 0.2)
- tweenCam("Recoil", V3(), Sine, 0.2)
- for _, v in pairs(Main:GetChildren()) do
- if v.Name:sub(1, 7) == "FlashFX" then
- Gun.Bolt.Transparency = 0
- Gun.BoltBack.Transparency = 1
- v.Enabled = false
- end
- end
- end)
- updateClipAmmo()
- firstShot = false
- shotCount = shotCount + 1
- lastSideRecoil[(shotCount % 2) + 1] = sideRecoilAlpha
- end
- function markHit()
- spawn(function()
- if mainGUI:IsDescendantOf(game) then
- hitMarker.Visible = true
- local startMark = tick()
- hitMarker.lastMark.Value = startMark
- wait(0.5)
- if hitMarker.lastMark.Value <= startMark then
- hitMarker.Visible = false
- end
- end
- end)
- end
- --------------------[ ADS FUNCTIONS ]-------------------------------------------------
- function aimGun()
- if Reloading or Knifing or isCrawling or (not S.canADS) then return end
- mouseSensitivity = aimSensitivity
- for _, Plugin in pairs(Plugins.Aimed) do
- spawn(function()
- Plugin()
- end)
- end
- Aimed = true
- Aiming = true
- Running = false
- spreadZoom = "Aimed"
- baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
- if S.aimSettings.Anim then
- local currentFOV = Cam.FieldOfView
- local currentTrans = Scope.BackgroundTransparency
- tweenJoint(LWeld, armC0[1], S.aimedC1.leftArm, Sine, S.aimSettings.Speed)
- tweenJoint(RWeld, armC0[2], S.aimedC1.rightArm, Sine, S.aimSettings.Speed)
- tweenJoint(LWeld2, nil, CF(), Sine, S.aimSettings.Speed)
- tweenJoint(RWeld2, nil, CF(), Sine, S.aimSettings.Speed)
- tweenJoint(Grip, nil, aimedGripCF, Sine, S.aimSettings.Speed)
- tweenJoint(headWeld2, nil, CF(0, -0.5, 0) * CFANG(0, 0, S.aimSettings.headTilt) * CF(0, 0.5, 0), Sine, S.aimSettings.Speed)
- local t0 = tick()
- while true do
- RS.RenderStepped:wait()
- local Alpha = math.min((tick() - t0) / S.aimSettings.Speed, 1) * 90
- if (not Aimed) then break end
- if (not Selected) then break end
- aimAlpha = Sine(Alpha)
- aimHeadOffset = headOffset.X * aimAlpha
- jumpAnimMultiplier = numLerp(1, S.fallSettings.aimEffect, aimAlpha)
- translationDivisor = numLerp(7, 20, aimAlpha)
- rotationMultiplier = numLerp(S.momentumSettings.Amplitude.unAimed, S.momentumSettings.Amplitude.Aimed, aimAlpha)
- armTiltMultiplier = numLerp(1, 0.2, aimAlpha)
- Cam.FieldOfView = numLerp(currentFOV, S.aimSettings.FOV, aimAlpha)
- if S.guiScope then
- Scope.BackgroundTransparency = numLerp(currentTrans, 0, aimAlpha)
- end
- if Alpha == 90 then break end
- end
- else
- LWeld.C0, LWeld.C1 = armC0[1], S.aimedC1.leftArm
- RWeld.C0, RWeld.C1 = armC0[2], S.aimedC1.rightArm
- LWeld2.C1, RWeld2.C1 = CF(), CF()
- animWeld.C0 = CF(0, 1, 0)
- Grip.C1 = aimedGripCF
- headWeld2.C1 = CF(0, -0.5, 0) * CFANG(0, 0, S.aimSettings.headTilt) * CF(0, 0.5, 0)
- aimAlpha = 1
- aimHeadOffset = headOffset.X
- jumpAnimMultiplier = S.fallSettings.aimEffect
- translationDivisor = 20
- rotationMultiplier = S.momentumSettings.Amplitude.Aimed
- armTiltMultiplier = 0.2
- Cam.FieldOfView = S.aimSettings.FOV
- end
- Aiming = (not Aimed)
- if (not Aiming) and S.guiScope then
- spawn(function()
- scopeSteady.Visible = true
- Scope.BackgroundTransparency = 1
- scopeMain.Visible = true
- if armTable then
- for _, Obj in pairs(armTable[1].Model:GetChildren()) do
- if Obj:IsA("BasePart") then
- Obj.LocalTransparencyModifier = 1
- end
- end
- for _, Obj in pairs(armTable[2].Model:GetChildren()) do
- if Obj:IsA("BasePart") then
- Obj.LocalTransparencyModifier = 1
- end
- end
- elseif armModel then
- for _, Obj in pairs(armModel:GetChildren()) do
- if Obj:IsA("BasePart") then
- Obj.LocalTransparencyModifier = 1
- end
- end
- end
- for _, Obj in pairs(playerFolder:GetChildren()) do
- if Obj:IsA("BasePart") then
- Obj.LocalTransparencyModifier = 1
- end
- end
- for _, Obj in pairs(Gun:GetChildren()) do
- if Obj:IsA("BasePart") then
- Obj.LocalTransparencyModifier = 1
- end
- end
- end)
- spawn(function()
- local camAng = 0
- local idleCam = function()
- return V3(
- RAD(SIN(camAng * S.scopeSettings.Frequency.Idling)) * stanceSway * camSway * S.scopeSettings.Amplitude.Idling,
- RAD(SIN(camAng * 5 / 2 * S.scopeSettings.Frequency.Idling)) * stanceSway * camSway * S.scopeSettings.Amplitude.Idling * 0.75,
- 0
- )
- end
- local walkCam = function()
- return V3(
- RAD(SIN(camAng * S.scopeSettings.Frequency.Walking)) * camSway * stanceSway * S.scopeSettings.Amplitude.Walking,
- RAD(SIN(camAng * 5 / 2 * S.scopeSettings.Frequency.Walking)) * camSway * stanceSway * S.scopeSettings.Amplitude.Walking * 0.75,
- 0
- )
- end
- while Aimed do
- local dt = RS.RenderStepped:wait()
- camOffsets.guiScope.Rot = (Sine(idleAlpha) * idleCam()) + (Sine(walkAlpha) * walkCam())
- camAng = camAng + RAD(105 * dt) * stanceSway * camSway
- end
- end)
- end
- end
- function unAimGun(Exception)
- if (not S.canADS) then return end
- mouseSensitivity = S.sensitivitySettings.Default
- for _, Plugin in pairs(Plugins.UnAimed) do
- spawn(function()
- Plugin()
- end)
- end
- if S.guiScope then
- spawn(function()
- if armTable then
- for _, Obj in pairs(armTable[1].Model:GetChildren()) do
- if Obj:IsA("BasePart") then
- Obj.LocalTransparencyModifier = 0
- end
- end
- for _, Obj in pairs(armTable[2].Model:GetChildren()) do
- if Obj:IsA("BasePart") then
- Obj.LocalTransparencyModifier = 0
- end
- end
- elseif armModel then
- for _, Obj in pairs(armModel:GetChildren()) do
- if Obj:IsA("BasePart") then
- Obj.LocalTransparencyModifier = 0
- end
- end
- end
- for _, Obj in pairs(playerFolder:GetChildren()) do
- if Obj:IsA("BasePart") then
- Obj.LocalTransparencyModifier = 0
- end
- end
- for _, Obj in pairs(Gun:GetChildren()) do
- if Obj:IsA("BasePart") then
- Obj.LocalTransparencyModifier = 0
- end
- end
- end)
- end
- if (not Exception) then
- if (not Aimed) then return end
- if (Reloading and Exception) or Knifing then return end
- spreadZoom = "unAimed"
- baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
- Aimed = false
- Aiming = true
- if S.aimSettings.Anim then
- local currentFOV = Cam.FieldOfView
- local currentTrans = (Scope.BackgroundTransparency == 1 and (S.guiScope and 0 or 1) or Scope.BackgroundTransparency)
- scopeMain.Visible = false
- scopeSteady.Visible = false
- tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, S.aimSettings.Speed)
- tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, S.aimSettings.Speed)
- tweenJoint(headWeld2, nil, CF(), Sine, S.aimSettings.Speed)
- tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, S.aimSettings.Speed)
- local t0 = tick()
- while true do
- RS.RenderStepped:wait()
- local Alpha = math.min((tick() - t0) / S.aimSettings.Speed, 1) * 90
- if Aimed then break end
- if (not Selected) then break end
- aimAlpha = 1 - Sine(Alpha)--1 - COS(RAD(X))
- aimHeadOffset = headOffset.X * aimAlpha
- jumpAnimMultiplier = numLerp(1, S.fallSettings.aimEffect, aimAlpha)
- translationDivisor = numLerp(7, 20, aimAlpha)
- rotationMultiplier = numLerp(S.momentumSettings.Amplitude.unAimed, S.momentumSettings.Amplitude.Aimed, aimAlpha)
- armTiltMultiplier = numLerp(1, 0.2, aimAlpha)
- Cam.FieldOfView = numLerp(80, currentFOV, aimAlpha)
- Scope.BackgroundTransparency = numLerp(1, currentTrans, aimAlpha)
- if Alpha == 90 then break end
- end
- else
- scopeMain.Visible = false
- scopeSteady.Visible = false
- LWeld.C0, LWeld.C1 = armC0[1], S.unAimedC1.leftArm
- RWeld.C0, RWeld.C1 = armC0[2], S.unAimedC1.rightArm
- headWeld2.C0 = CF()
- Grip.C1 = S.unAimedC1.Grip
- aimAlpha = 0
- aimHeadOffset = 0
- jumpAnimMultiplier = 1
- translationDivisor = 7
- rotationMultiplier = S.momentumSettings.Amplitude.unAimed
- armTiltMultiplier = 1
- Cam.FieldOfView = 80
- Scope.BackgroundTransparency = 1
- end
- Aiming = Aimed
- else
- spawn(function()
- Aimed = false
- Aiming = false
- spreadZoom = "unAimed"
- baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
- local currentFOV = Cam.FieldOfView
- local currentTrans = (Scope.BackgroundTransparency == 1 and (S.guiScope and 0 or 1) or Scope.BackgroundTransparency)
- scopeMain.Visible = false
- scopeSteady.Visible = false
- tweenJoint(headWeld2, nil, CF(), Sine, S.aimSettings.Speed)
- if S.aimSettings.Anim then
- local t0 = tick()
- while true do
- RS.RenderStepped:wait()
- local Alpha = math.min((tick() - t0) / S.aimSettings.Speed, 1) * 90
- if Aimed then break end
- if (not Selected) then break end
- aimAlpha = 1 - Sine(Alpha)--1 - COS(RAD(90 - Alpha))
- aimHeadOffset = headOffset.X * aimAlpha
- jumpAnimMultiplier = numLerp(1, S.fallSettings.aimEffect, aimAlpha)
- translationDivisor = numLerp(7, 20, aimAlpha)
- rotationMultiplier = numLerp(S.momentumSettings.Amplitude.unAimed, S.momentumSettings.Amplitude.Aimed, aimAlpha)
- armTiltMultiplier = numLerp(1, 0.2, aimAlpha)
- Cam.FieldOfView = numLerp(80, currentFOV, aimAlpha)
- Scope.BackgroundTransparency = numLerp(1, currentTrans, aimAlpha)
- if Alpha == 90 then break end
- end
- else
- scopeMain.Visible = false
- scopeSteady.Visible = false
- aimAlpha = 0
- aimHeadOffset = 0
- jumpAnimMultiplier = 1
- translationDivisor = 7
- rotationMultiplier = S.momentumSettings.Amplitude.unAimed
- armTiltMultiplier = 1
- Cam.FieldOfView = 80
- Scope.BackgroundTransparency = 1
- end
- end)
- end
- end
- --------------------[ TEXTURE CREATION FUNCTIONS ]------------------------------------
- function createBullet(Direction)
- local Origin = Gun.Main.CFrame.p
- local bulletCF = CF(Origin, Origin + Direction)
- local Bullet = Instance.new("Part")
- Bullet.BrickColor = S.bulletSettings.Color
- Bullet.Material = Enum.Material.Neon
- Bullet.Name = "Bullet"
- Bullet.CanCollide = false
- Bullet.FormFactor = "Custom"
- Bullet.Size = S.bulletSettings.Size
- Bullet.BottomSurface = "Smooth"
- Bullet.TopSurface = "Smooth"
- if math.min(S.bulletSettings.Size.X, S.bulletSettings.Size.Y, S.bulletSettings.Size.Z) < 0.2 then
- local Mesh = Instance.new("BlockMesh")
- Mesh.Scale = S.bulletSettings.Size / Vector3.new(
- math.max(S.bulletSettings.Size.X, 0.2),
- math.max(S.bulletSettings.Size.Y, 0.2),
- math.max(S.bulletSettings.Size.Z, 0.2)
- )
- Mesh.Parent = Bullet
- end
- local BF = Instance.new("BodyForce")
- BF.force = V3(0, Bullet:GetMass() * (196.2 - S.bulletSettings.Acceleration), 0)
- BF.Parent = Bullet
- Bullet.Parent = gunIgnore
- Bullet.CFrame = bulletCF + Direction * S.bulletSettings.Size.Z / 2
- Bullet.Velocity = Direction * S.bulletSettings.Velocity
- return Bullet
- end
- --------------------[ HIT HANDLING FUNCTIONS ]----------------------------------------
- function getBaseDamage(Dist)
- local startDmg = S.damageSettings.Start.Damage
- local startDist = S.damageSettings.Start.Dist
- local endDmg = S.damageSettings.End.Damage
- local endDist = S.damageSettings.End.Dist
- return (
- (
- Dist < startDist * S.bulletSettings.Range
- ) and startDmg or
- (
- Dist >= startDist * S.bulletSettings.Range and
- Dist < endDist * S.bulletSettings.Range
- ) and numLerp(startDmg, endDmg, Map(Dist / S.bulletSettings.Range, startDist, endDist, 0, 1)) or
- (
- Dist >= endDist * S.bulletSettings.Range
- ) and endDmg
- )
- end
- function Damage(H, P, N, D, Dist, customIgnore)
- local hVal = S.damageSettings.Multipliers.Head
- local cVal = S.damageSettings.Multipliers.Chest
- local lVal = S.damageSettings.Multipliers.Limbs
- local baseDamage = getBaseDamage(Dist)
- if Humanoid.Health ~= 0 then
- local hitHumanoid = nil
- if H.Parent:IsA("Hat") then
- table.insert(customIgnore, H)
- local newRay = Ray.new(P - D * 0.1, D * (S.bulletSettings.Range - Dist + 0.1))
- local newH, newP, newN = workspace:FindPartOnRayWithIgnoreList(newRay, customIgnore)
- if newH then
- hitHumanoid = Damage(newH, newP, newN, D, Dist + (newP - P).magnitude, customIgnore)
- end
- else
- hitHumanoid = findFirstClass(H.Parent, "Humanoid")
- if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
- local Tag = Instance.new("ObjectValue")
- Tag.Value = Player
- Tag.Name = "creator"
- Tag.Parent = hitHumanoid
- DS:AddItem(Tag, 0.3)
- local chosenDamage = 0
- if H.Name == "Head" then
- chosenDamage = baseDamage * RAND(hVal, hVal + 0.1, 0.01)
- elseif H.Name == "Torso" then
- chosenDamage = baseDamage * RAND(cVal, cVal + 0.1, 0.01)
- else
- chosenDamage = baseDamage * RAND(lVal, lVal + 0.1, 0.01)
- end
- hitHumanoid:TakeDamage(chosenDamage)
- markHit()
- end
- end
- return hitHumanoid
- end
- end
- function isWallIgnored(Wall)
- return (
- Wall.Transparency >= S.penetrationSettings.transparencyThreshold or
- (S.penetrationSettings.ignoreNonCanCollide and (not Wall.CanCollide)) or
- isIgnored(Wall, S.penetrationSettings.ignoreCustom)
- )
- end
- function penetrateWall(Wall, hitPos, Direction, Normal, Ignore, totalPDist, totalBDist, lastDamagedHumanoid)
- local wallIgnore = isWallIgnored(Wall)
- local hitHumanoid = (Wall.Parent:IsA("Hat") and findFirstClass(Wall.Parent.Parent, "Humanoid") or findFirstClass(Wall.Parent, "Humanoid"))
- local damagedHumanoid = nil
- if hitHumanoid and hitHumanoid ~= lastDamagedHumanoid then
- lastDamagedHumanoid = hitHumanoid
- damagedHumanoid = Damage(Wall, hitPos, Normal, Direction, totalBDist, {Char, ignoreModel})
- else
- lastDamagedHumanoid = nil
- end
- local ignoreObject = hitHumanoid and (Wall.Parent:IsA("Hat") and Wall.Parent.Parent or Wall.Parent) or Wall
- table.insert(Ignore, ignoreObject)
- local rayLength = S.bulletSettings.Range - totalBDist
- local testRay = Ray.new(hitPos, Direction * (S.bulletSettings.Range - totalBDist))
- local H1, P1, N1 = workspace:FindPartOnRayWithIgnoreList(testRay, Ignore)
- local newIgnore = removeElement(Ignore, ignoreObject)
- local wallRay = Ray.new(P1 + Direction * 0.1, -Direction * (rayLength + 1))
- local H2, P2, N2 = workspace:FindPartOnRayWithIgnoreList(wallRay, Ignore)
- local newPDist = totalPDist + (wallIgnore and 0 or (getNearestPoint(P1, P2, hitPos) - hitPos).magnitude)
- local newBDist = totalBDist + (P1 - hitPos).magnitude
- local outOfRange = Round(newPDist, 0.001) > S.penetrationSettings.Dist or Round(newBDist, 0.001) > S.bulletSettings.Range
- if (not wallIgnore) then
- createBulletImpact:FireServer(Wall, hitPos, Normal, Direction, hitHumanoid, gunIgnore, S)
- if (not hitHumanoid) then
- createShockwave:FireServer(hitPos, S.shockwaveSettings.Radius, gunIgnore, S)
- end
- end
- if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) and hitHumanoid == damagedHumanoid then
- createBlood:FireServer(Wall, P2, Direction, gunIgnore, S)
- end
- if outOfRange or (not H1) then
- if (not outOfRange) and (not wallIgnore) then
- createBulletImpact:FireServer(Wall, P2, N2, Direction, hitHumanoid, gunIgnore, S)
- if (not hitHumanoid) then
- createShockwave:FireServer(P2, S.shockwaveSettings.Radius, gunIgnore, S)
- end
- end
- return Wall, hitPos
- else
- if Wall == H2 and (not wallIgnore) then
- createBulletImpact:FireServer(Wall, P2, N2, Direction, hitHumanoid, gunIgnore, S)
- if (not hitHumanoid) then
- createShockwave:FireServer(P2, S.shockwaveSettings.Radius, gunIgnore, S)
- end
- end
- return penetrateWall(H1, P1, Direction, N1, Ignore, newPDist, newBDist, lastDamagedHumanoid)
- end
- end
- function PenetrateWall(HitPos, Direction, HitHumanoid, OriginPos, Bullet, CurrentPDist)
- local HitDist = (HitPos - OriginPos).magnitude
- local Wall, WallHitPos = nil, nil
- local Hum, HumHitPos = nil, nil
- local CustomIgnore = {unpack(Ignore)}
- for i = 1, 10 do
- local WallRay = Ray.new(HitPos - (Direction * 0.1), Direction * S.Penetration)
- local H, P = game.Workspace:FindPartOnRayWithIgnoreList(WallRay, CustomIgnore)
- if H then
- local HitHumanoid = nil
- if H.Parent.ClassName == "Hat" then
- HitHumanoid = findFirstClass(H.Parent.Parent, "Humanoid")
- else
- HitHumanoid = findFirstClass(H.Parent, "Humanoid")
- end
- if HitHumanoid and i ~= 1 then
- Hum, HumHitPos = H, P
- break
- else
- Wall, WallHitPos = H, P
- table.insert(CustomIgnore, H)
- end
- else
- break
- end
- end
- if Wall then
- if S.InstantHit then
- if Hum then
- Damage(Hum.Parent:FindFirstChild("Head"), HumHitPos)
- return HumHitPos
- else
- local HitObj2, HitPos2 = nil, nil
- if HitHumanoid then
- HitObj2, HitPos2 = AdvRayCast(WallHitPos, Direction, S.BulletRange - HitDist, {Wall, HitHumanoid.Parent, unpack(Ignore)})
- else
- HitObj2, HitPos2 = AdvRayCast(WallHitPos, Direction, S.BulletRange - HitDist, {Wall, unpack(Ignore)})
- end
- Damage(HitObj2, HitPos2)
- local NewPDist = CurrentPDist + (WallHitPos - HitPos).magnitude
- local NewHitPos2 = HitPos2
- if NewPDist < S.Penetration and HitObj2 then
- NewHitPos2 = PenetrateWall(HitPos2, Direction, HitHumanoid, OriginPos, Bullet, CurrentPDist + NewPDist)
- end
- return NewHitPos2
- end
- else
- local LastPos = WallHitPos
- local TotalDistTraveled = 0
- spawn(function()
- if Hum then
- Damage(Hum.Parent:FindFirstChild("Head"), HumHitPos)
- return HumHitPos
- else
- while true do
- RS.RenderStepped: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, {Wall, HitHumanoid.Parent, unpack(Ignore)})
- else
- TempHitObj, TempHitPos = AdvRayCast(LastPos, NewDirection, DistTraveled, {Wall, unpack(Ignore)})
- end
- if TempHitObj then
- Damage(TempHitObj, TempHitPos)
- local NewPDist = CurrentPDist + (WallHitPos - HitPos).magnitude
- local NewTempPos = TempHitPos
- if NewPDist < S.Penetration and TempHitObj then
- NewTempPos = PenetrateWall(TempHitPos, Direction, HitHumanoid, OriginPos, Bullet, CurrentPDist + NewPDist)
- else
- Bullet:Destroy()
- end
- return NewTempPos
- else
- LastPos = Bullet.Position
- TotalDistTraveled = TotalDistTraveled + DistTraveled
- end
- 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 animateReload()
- tweenJoint(LWeld2, CF(), CF(), Sine, 0.15)
- tweenJoint(RWeld2, CF(), CF(), Sine, 0.15)
- local magParts = {}
- local magTable = {}
- for _, Obj in pairs(Gun:GetChildren()) do
- if string.sub(Obj.Name, 1, 3) == "Mag" and Obj:IsA("BasePart") then
- INSERT(magParts, Obj)
- end
- end
- local animVars = {
- --FUNCTIONS--
- tweenJoint = tweenJoint;
- makeMagInvisible = function()
- for _, v in pairs(magParts) do
- v.Transparency = 1
- end
- magVisible = false
- end;
- makeMagVisible = function()
- for _, v in pairs(magParts) do
- v.Transparency = v:WaitForChild("magTrans").Value
- end
- magVisible = true
- end;
- isMagVisible = function()
- return magVisible
- end;
- isMagEmpty = function()
- return ammoInClip == 0
- end;
- setNewMag = function()
- newMag = true
- end;
- isNewMag = function()
- return newMag
- end;
- createMag = function(Key)
- local magModel = Instance.new("Model")
- local magClones = {}
- for i, v in pairs(magParts) do
- local vClone = v:Clone()
- vClone.Transparency = v:WaitForChild("magTrans").Value
- vClone.CanCollide = false
- vClone.Parent = magModel
- INSERT(magClones, {Original = v, magClone = vClone})
- if i ~= 1 then
- local W = Instance.new("Weld")
- W.Part0 = magClones[1].magClone
- W.Part1 = vClone
- W.C0 = magClones[1].magClone.CFrame:toObjectSpace(vClone.CFrame)
- W.Parent = magClones[1].magClone
- end
- end
- magTable[Key] = {magModel, magClones}
- return magModel, magClones
- end;
- getMag = function(Key)
- if magTable[Key] then
- return magTable[Key][1], magTable[Key][2]
- else
- return nil, nil
- end
- end;
- attachGripToHead = function()
- local handleCF = RArm.CFrame * Grip.C0
- Grip.C0 = Head.CFrame:toObjectSpace(handleCF)
- Grip.Part0 = Head
- end;
- attachGripToArm = function()
- local handleCF = Head.CFrame * Grip.C0
- Grip.C0 = RArm.CFrame:toObjectSpace(handleCF)
- Grip.Part0 = RArm
- end;
- Sine = Sine;
- Linear = Linear;
- --VARIABLES--
- Handle = Handle;
- LArm = LArm;
- RArm = RArm;
- LWeld = LWeld;
- RWeld = RWeld;
- LC0 = armC0[1];
- RC0 = armC0[2];
- Grip = Grip;
- gunIgnore = gunIgnore;
- Cam = Cam;
- CF = CF;
- CFANG = CFANG;
- V3 = V3;
- RAD = RAD;
- reloadTimeLoaded = S.reloadSettings.Times.Loaded;
- reloadTimeEmpty = S.reloadSettings.Times.Empty
- }
- local sequenceTable = Anims.Reload(animVars)
- --local T = tick()
- for _, reloadFunction in pairs(sequenceTable) do
- if breakReload then
- break
- end
- reloadFunction()
- if (not magVisible) then
- Ammo.Value = 0
- end
- updateClipAmmo()
- end
- --print(tick() - T) --I divide the reloadTime by this number to get the animation speed
- if (not isCrawling) then
- if Running and (not S.canFireWhileRunning) then
- tweenJoint(LWeld, armC0[1], S.runningC1.leftArm, Sine, 0.4)
- tweenJoint(RWeld, armC0[2], S.runningC1.rightArm, Sine, 0.4)
- tweenJoint(Grip, nil, S.runningC1.Grip, Sine, 0.4)
- else
- tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
- tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
- tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
- end
- end
- for _, v in pairs(magTable) do --In case the reload animations was stopped mid way and there were still fake mags that weren't deleted
- v[1]:Destroy()
- end
- end
- function Reload()
- if Ammo.Value < (ClipSize.Value + 1) and (not Reloading) and StoredAmmo.Value > 0 then
- Firing = false
- ammoInClip = (ammoInClip == 0 and Ammo.Value or ammoInClip)
- Reloading = true
- lowerSpread()
- if Aimed then unAimGun(S.reloadSettings.Anim) end
- crossHair.Reload.Visible = true
- if Handle:FindFirstChild("ReloadSound") then Handle.ReloadSound:Play() end
- if S.reloadSettings.Anim then
- wait()
- animateReload()
- else
- local startReload = tick()
- local initialReloadTime = Ammo.Value == 0 and S.reloadSettings.Times.Empty or S.reloadSettings.Times.Loaded
- while true do
- if breakReload then break end
- if (tick() - startReload) >= initialReloadTime then break end
- RS.RenderStepped:wait()
- end
- end
- if (not breakReload) then
- newMag = false
- if StoredAmmo.Value >= ClipSize.Value then
- if ammoInClip > 0 then
- StoredAmmo.Value = StoredAmmo.Value - ((ClipSize.Value + 1) - ammoInClip)
- Ammo.Value = ClipSize.Value + 1
- else
- StoredAmmo.Value = StoredAmmo.Value - ClipSize.Value
- Ammo.Value = ClipSize.Value
- end
- elseif StoredAmmo.Value < ClipSize.Value and StoredAmmo.Value > 0 then
- Ammo.Value = StoredAmmo.Value
- StoredAmmo.Value = 0
- end
- end
- Reloading = false
- if Selected then
- ammoInClip = (breakReload and ammoInClip or 0)
- crossHair.Reload.Visible = false
- end
- breakReload = false
- end
- updateClipAmmo()
- updateStoredAmmo()
- end
- --------------------[ EXTERNAL DATA LOCATING FUNCTIONS ]-----------------------------
- function removeElement(Table, Element) --removes the first instance of Element from Table
- for i, v in pairs(Table) do
- if v == Element then
- table.remove(Table, i)
- break
- end
- end
- return Table
- end
- 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, Table)
- for _,v in pairs(Table) 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
- --------------------[ JUMPING ANIMATION ]---------------------------------------------
- function onFall(initialVelocity)
- spawn(function()
- local velocityAlpha = math.max(math.min(initialVelocity / Humanoid.JumpPower, 1), 0)
- local startJumpPos = jumpAnim.Pos
- local startJumpRot = jumpAnim.Rot
- local endJumpPos = 0.04 * S.fallSettings.fallMultiplier * velocityAlpha
- local endJumpRot = RAD(4) * S.fallSettings.fallMultiplier * velocityAlpha
- local t0 = tick()
- while true do
- RS.Heartbeat:wait()
- local Alpha = math.min((tick() - t0) / 0.15, 1) * 90
- if onGround then break end
- jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Sine(Alpha))
- jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Sine(Alpha))
- if Alpha == 90 then break end
- end
- startJumpPos = endJumpPos
- startJumpRot = endJumpRot
- endJumpPos = -0.08 * S.fallSettings.fallMultiplier
- endJumpRot = -RAD(8) * S.fallSettings.fallMultiplier
- local X = 1
- while true do
- local dt = RS.Heartbeat:wait()
- X = X + (dt * 60) / X
- local Alpha = (X - 1) / 15
- if onGround then break end
- jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Alpha)
- jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Alpha)
- end
- end)
- end
- function onLand(fallDist)
- spawn(function()
- local animAlpha = math.min(fallDist, S.fallSettings.maxDist) * (2 / 3)
- local startJumpPos = jumpAnim.Pos
- local startJumpRot = jumpAnim.Rot
- local endJumpPos = animAlpha / 100 * S.fallSettings.landMultiplier * (runReady and 1 or 2)
- local endJumpRot = RAD(animAlpha) * S.fallSettings.landMultiplier * (runReady and 1 or 2)
- local t0 = tick()
- while true do
- RS.Heartbeat:wait()
- local Alpha = math.min((tick() - t0) / 0.2, 1)
- if (not onGround) then break end
- jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Alpha)
- jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Alpha)
- if Alpha == 1 then break end
- end
- t0 = tick()
- while true do
- RS.Heartbeat:wait()
- local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
- if (not onGround) then break end
- jumpAnim.Pos = numLerp(endJumpPos, 0, Sine(Alpha))
- jumpAnim.Rot = numLerp(endJumpRot, 0, Sine(Alpha))
- if Alpha == 90 then break end
- end
- end)
- end
- function onHumanoidStateChanged(oldState, newState)
- if newState == Enum.HumanoidStateType.Freefall then
- onGround = false
- if S.fallAnimation then
- onFall(HRP.Velocity.Y)
- while HRP.Velocity.Y > 0 do RS.RenderStepped:wait() end
- startFallHeight = HRP.Position.Y
- end
- elseif oldState == Enum.HumanoidStateType.Freefall then
- onGround = true
- if S.fallAnimation then
- local fallDist = startFallHeight - HRP.Position.Y
- onLand(fallDist)
- end
- end
- end
- --------------------[ CAMERA STEADYING FUNCTIONS ]------------------------------------
- function steadyCamera()
- scopeSteady.Text = "Steadying..."
- scopeSteady.TextColor3 = Color3.new(1, 1, 0)
- camSteady = true
- local originalSway = camSway
- local Increment = 1.5 / 0.6
- local X = 0
- while true do
- RS.RenderStepped:wait()
- local newX = X + Increment
- X = (newX > 90 and 90 or newX)
- if (not steadyKeyPressed) then break end
- camSway = numLerp(originalSway, 0, Sine(X))
- if X == 90 then break end
- end
- while steadyKeyPressed and Aimed do
- if currentSteadyTime > 0 then
- local NewSteadyTime = currentSteadyTime - 1
- currentSteadyTime = (NewSteadyTime < 0 and 0 or NewSteadyTime)
- camSway = 0
- elseif currentSteadyTime == 0 then
- break
- end
- RS.RenderStepped:wait()
- end
- camSteady = false
- spawn(function()
- local Increment = 1.5 / 0.25
- local X = 0
- while true do
- RS.RenderStepped:wait()
- local newX = X + Increment
- X = (newX > 90 and 90 or newX)
- if camSteady then break end
- camSway = numLerp(0, S.scopeSettings.camSwayOnBreath, 1 - COS(RAD(X)))
- if X == 90 then break end
- end
- Increment = 1.5 / S.scopeSettings.breathTime
- X = 0
- while true do
- RS.RenderStepped:wait()
- local newX = X + Increment
- X = (newX > 90 and 90 or newX)
- if camSteady then break end
- camSway = numLerp(S.scopeSettings.camSwayOnBreath, 1, Sine(X))
- if X == 90 then break end
- end
- --[[for X = 0, 90, 1.5 / 0.2 do
- local Alpha = 1 - COS(RAD(X))--math.log10(X) / math.log10(90)
- camSway = numLerp(0, 3, Alpha)
- RS.RenderStepped:wait()
- end]]
- --[[for X = 0, 90, 1.5 / S.scopeSettings.steadyTime do
- if camSteady then break end
- local Alpha = SIN(RAD(X))
- camSway = numLerp(3, 1, Alpha)
- RS.RenderStepped:wait()
- end]]
- end)
- retakeBreath()
- end
- function retakeBreath()
- scopeSteady.Text = "Re-taking Breath"
- scopeSteady.TextColor3 = Color3.new(1, 0, 0)
- takingBreath = true
- local Increment = S.scopeSettings.steadyTime / S.scopeSettings.breathTime
- while takingBreath do
- if currentSteadyTime < maxSteadyTime then
- local newSteadyTime = currentSteadyTime + Increment
- currentSteadyTime = (newSteadyTime > maxSteadyTime and maxSteadyTime or newSteadyTime)
- elseif currentSteadyTime >= maxSteadyTime then
- break
- end
- RS.RenderStepped:wait()
- end
- if takingBreath then
- scopeSteady.Text = "Hold "..convertKey(S.Keys.scopeSteady).." to Steady"
- scopeSteady.TextColor3 = Color3.new(1, 1, 0)
- takingBreath = false
- end
- end
- --------------------[ SPRINTING FUNCTIONS ]-------------------------------------------
- function canRun(midRun)
- return ((Forward and (not Backward)) and
- Walking and (Stamina > 0) and Running and
- Selected and (midRun and true or onGround) and
- runReady and (S.canFireWhileRunning and true or (not Firing))
- )
- end
- function monitorStamina()
- Running = true
- if (not canRun(false)) then
- Running = false
- return
- end
- if Aimed then unAimGun(true) end
- if Stance == 1 or Stance == 2 then Stand() end
- if (not (Reloading and S.reloadSettings.Anim)) then
- if S.canFireWhileRunning then
- tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
- tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
- tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
- else
- tweenJoint(LWeld, armC0[1], S.runningC1.leftArm, Sine, 0.4)
- tweenJoint(RWeld, armC0[2], S.runningC1.rightArm, Sine, 0.4)
- tweenJoint(Grip, nil, S.runningC1.Grip, Sine, 0.4)
- end
- end
- crossOffset = 50
- while runKeyPressed do
- if canRun(true) then
- if onGround then
- local newStamina = Stamina - 1
- Stamina = (newStamina < 0 and 0 or newStamina)
- end
- else
- break
- end
- RS.RenderStepped:wait()
- end
- Running = false
- if (not Aimed) and (not (Reloading and S.reloadSettings.Anim)) and (not S.canFireWhileRunning) then
- crossOffset = 0
- tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
- tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
- tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
- end
- rechargeStamina()
- end
- function rechargeStamina()
- chargingStamina = true
- while ((not runKeyPressed) 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.RenderStepped:wait()
- end
- chargingStamina = false
- end
- --------------------[ STANCE FUNCTIONS ]----------------------------------------------
- function Stand(onDeselected)
- local LHip = Torso["Left Hip"]
- local RHip = Torso["Right Hip"]
- LLegWeld.Part1 = nil
- LHip.Part1 = LLeg
- RLegWeld.Part1 = nil
- RHip.Part1 = RLeg
- Stance = 0
- spreadStance = "Stand"
- baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
- if S.stanceSettings.Anim and (not onDeselected) then
- spawn(function()
- local prevStanceSway = stanceSway
- local X = 0
- local Increment = 1.5 / S.stanceSettings.Speed
- while true do
- RS.RenderStepped:wait()
- local newX = X + Increment
- X = (newX > 90 and 90 or newX)
- if Stance ~= 0 then break end
- stanceSway = numLerp(prevStanceSway, 1, Sine(X))
- if X == 90 then break end
- end
- end)
- tweenJoint(ABWeld, CF(), nil, Sine, S.stanceSettings.Speed)
- tweenJoint(LLegWeld, legC0.Stand[1], nil, Sine, S.stanceSettings.Speed)
- tweenJoint(RLegWeld, legC0.Stand[2], nil, Sine, S.stanceSettings.Speed)
- tweenJoint(LHip, CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0), Sine, S.stanceSettings.Speed)
- 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.stanceSettings.Speed)
- tweenJoint(Root, CFANG(RAD(-90), 0, RAD(180)), nil, Sine, S.stanceSettings.Speed)
- tweenJoint(headWeld, CF(0, 1.5, 0), nil, Sine, S.stanceSettings.Speed)
- elseif onDeselected or (not S.stanceSettings.Anim) then
- ABWeld.C0 = CF()
- LLegWeld.C0 = legC0.Stand[1]
- RLegWeld.C0 = legC0.Stand[2]
- LHip.C0, LHip.C1 = CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0)
- RHip.C0, RHip.C1 = CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0)
- Root.C0 = CFANG(RAD(-90), 0, RAD(180))
- headWeld.C0 = CF(0, 1.5, 0)
- end
- end
- function Crouch()
- local LHip = Torso["Left Hip"]
- local RHip = Torso["Right Hip"]
- LHip.Part1 = nil
- LLegWeld.Part1 = LLeg
- RHip.Part1 = nil
- RLegWeld.Part1 = RLeg
- Stance = 1
- spreadStance = "Crouch"
- baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
- if S.stanceSettings.Anim then
- spawn(function()
- local prevStanceSway = stanceSway
- local X = 0
- local Increment = 1.5 / S.stanceSettings.Speed
- while true do
- RS.RenderStepped:wait()
- local newX = X + Increment
- X = (newX > 90 and 90 or newX)
- if Stance ~= 1 then break end
- stanceSway = numLerp(prevStanceSway, 0.75, Sine(X))
- if X == 90 then break end
- end
- end)
- tweenJoint(ABWeld, CF(0, 0, -0.05), nil, Sine, S.stanceSettings.Speed)
- tweenJoint(LLegWeld, legC0.Crouch[1], nil, Sine, S.stanceSettings.Speed)
- tweenJoint(RLegWeld, legC0.Crouch[2], nil, Sine, S.stanceSettings.Speed)
- 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.stanceSettings.Speed)
- 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.stanceSettings.Speed)
- tweenJoint(Root, CF(0, -1, 0) * CFANG(RAD(-90), 0, RAD(180)), nil, Sine, S.stanceSettings.Speed)
- tweenJoint(headWeld, CF(0, 1.5, 0), nil, Sine, S.stanceSettings.Speed)
- else
- ABWeld.C0 = CF(0, 0, -1 / 16)
- LLegWeld.C0 = legC0.Crouch[1]
- RLegWeld.C0 = legC0.Crouch[2]
- LHip.C0, LHip.C1 = CF(-1, -0.5, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 0.5, 1) * CFANG(0, RAD(-90), RAD(-90))
- RHip.C0, RHip.C1 = CF(1, -0.5, 0.25) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 0.5, 1) * CFANG(RAD(-180), RAD(90), 0)
- Root.C0 = CF(0, -1, 0) * CFANG(RAD(-90), 0, RAD(180))
- headWeld.C0 = CF(0, 1.5, 0)
- end
- end
- function Prone()
- local LHip = Torso["Left Hip"]
- local RHip = Torso["Right Hip"]
- LHip.Part1 = nil
- LLegWeld.Part1 = LLeg
- RHip.Part1 = nil
- RLegWeld.Part1 = RLeg
- Stance = 2
- spreadStance = "Prone"
- baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
- if S.stanceSettings.Anim then
- spawn(function()
- local prevStanceSway = stanceSway
- local X = 0
- local Increment = 1.5 / S.stanceSettings.Speed
- while true do
- RS.RenderStepped:wait()
- local newX = X + Increment
- X = (newX > 90 and 90 or newX)
- if Stance ~= 2 then break end
- stanceSway = numLerp(prevStanceSway, 0.5, Sine(X))
- if X == 90 then break end
- end
- end)
- tweenJoint(ABWeld, CF(0, 0, -0.1), nil, Sine, S.stanceSettings.Speed)
- tweenJoint(LLegWeld, legC0.Prone[1], nil, Sine, S.stanceSettings.Speed)
- tweenJoint(RLegWeld, legC0.Prone[2], nil, Sine, S.stanceSettings.Speed)
- tweenJoint(Root, CF(0, -2.5, 1) * CFANG(RAD(180), 0, RAD(180)), nil, Sine, S.stanceSettings.Speed)
- tweenJoint(headWeld, CF(0, 1, 1) * CFANG(RAD(90), 0, 0), nil, Sine, S.stanceSettings.Speed)
- else
- ABWeld.C0 = CF(0, 0, -1 / 8)
- LLegWeld.C0 = legC0.Prone[1]
- RLegWeld.C0 = legC0.Prone[2]
- Root.C0 = CF(0, -2.5, 1) * CFANG(RAD(180), 0, RAD(180))
- headWeld.C0 = CF(0, 1, 1) * CFANG(RAD(90), 0, 0)
- end
- end
- function Dive()
- onGround = false
- local diveDirection = (HRP.CFrame * CFANG(S.diveSettings.Angle, 0, 0)).lookVector * S.walkSpeeds.Sprinting * S.diveSettings.Force
- local BF = Instance.new("BodyForce")
- BF.force = diveDirection + Vector3.new(0, playerMass * 196.2, 0)
- BF.Parent = HRP
- --[[spawn(function()
- HRP.Velocity = HRP.CFrame.lookVector * 60 + V3(0, 40, 0)
- wait(0.1)
- HRP.Velocity = HRP.CFrame.lookVector * 70 + V3(0, 30, 0)
- wait(0.4)
- HRP.Velocity = HRP.CFrame.lookVector * 30 + V3(0, -10, 0)
- end)]]
- delay(0.05, function()
- spawn(function()
- while true do
- local newRay = Ray.new(HRP.Position, V3(0, -3.1, 0))
- local H, _ = workspace:FindPartOnRayWithIgnoreList(newRay, Ignore)
- if H then
- onGround = true
- break
- end
- wait()
- end
- end)
- Prone()
- wait(0.1)
- BF:Destroy()
- end)
- end
- --------------------[ MOUSE FUNCTIONS ]-----------------------------------------------
- function onMB1Down()
- MB1Down = true
- firstShot = true
- if fireFunction then
- fireFunction()
- end
- end
- function onMB1Up()
- MB1Down = false
- lowerSpread()
- end
- function onMB2Down()
- if S.aimSettings.holdToADS then
- if (not AimingIn) and (not Aimed) then
- AimingIn = true
- aimGun()
- AimingIn = false
- end
- else
- if Aimed then
- unAimGun()
- else
- aimGun()
- end
- end
- end
- function onMB2Up()
- if S.aimSettings.holdToADS then
- if (not AimingOut) and Aimed then
- AimingOut = true
- unAimGun()
- AimingOut = false
- end
- end
- end
- function onScrollUp()
- local newAimSensitivity = aimSensitivity + S.sensitivitySettings.Increment
- aimSensitivity = (
- newAimSensitivity < S.sensitivitySettings.Min and S.sensitivitySettings.Min or
- newAimSensitivity > S.sensitivitySettings.Max and S.sensitivitySettings.Max or
- newAimSensitivity
- )
- mouseSensitivity = (Aimed and aimSensitivity or mouseSensitivity)
- Sens.Text = "S: "..aimSensitivity
- if mainGUI:IsDescendantOf(game) then
- Sens.Visible = true
- local t0 = tick()
- lastSensUpdate = t0
- wait(0.3)
- if lastSensUpdate <= t0 then
- Sens.Visible = true
- end
- end
- end
- function onScrollDown()
- local newAimSensitivity = aimSensitivity - S.sensitivitySettings.Increment
- aimSensitivity = (
- newAimSensitivity < S.sensitivitySettings.Min and S.sensitivitySettings.Min or
- newAimSensitivity > S.sensitivitySettings.Max and S.sensitivitySettings.Max or
- newAimSensitivity
- )
- mouseSensitivity = (Aimed and aimSensitivity or mouseSensitivity)
- Sens.Text = "S: "..aimSensitivity
- if mainGUI:IsDescendantOf(game) then
- Sens.Visible = true
- local t0 = tick()
- lastSensUpdate = t0
- wait(0.3)
- if lastSensUpdate <= t0 then
- Sens.Visible = true
- end
- end
- end
- --------------------[ KEYBOARD FUNCTIONS ]--------------------------------------------
- function keyDown(K)
- local Key = string.lower(K)
- if Key == S.Keys.lowerStance and S.canChangeStance then
- if (not Running) then
- if Stance == 0 then
- if S.stanceSettings.Stances.Crouch then
- Crouch()
- elseif S.stanceSettings.Stances.Prone then
- Prone()
- end
- elseif Stance == 1 then
- if S.stanceSettings.Stances.Prone then
- Prone()
- end
- end
- elseif S.dolphinDive then
- wait()
- if Humanoid:GetState() ~= Enum.HumanoidStateType.Freefall and (not UIS:IsKeyDown("Space")) and runReady then
- local tempConnection = Humanoid.Changed:connect(function()
- Humanoid.Jump = false
- end)
- runReady = false
- Dive()
- Running = false
- wait(S.diveSettings.rechargeTime)
- tempConnection:disconnect()
- runReady = true
- end
- end
- end
- if Key == S.Keys.raiseStance and S.canChangeStance then
- if (not Running) then
- if Stance == 2 then
- if S.stanceSettings.Stances.Crouch then
- Crouch()
- else
- Stand()
- end
- elseif Stance == 1 then
- Stand()
- end
- end
- end
- if Key == S.Keys.ADS then
- if S.aimSettings.holdToADS 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.Keys.selectFire and S.selectFire then
- if canSelectFire then
- canSelectFire = false
- rawFireMode = rawFireMode + 1
- modeGUI.Text = Modes[((rawFireMode - 1) % numModes) + 1]
- if modeGUI.Text == "AUTO" then
- fireFunction = autoFire
- elseif modeGUI.Text == "BURST" then
- fireFunction = burstFire
- elseif modeGUI.Text == "SEMI" then
- fireFunction = semiFire
- else
- fireFunction = nil
- end
- local speedAlpha = S.selectFireSettings.animSpeed / 0.6
- if S.selectFireSettings.GUI then
- spawn(function()
- fireSelect.Visible = true
- local prevRawFireMode = rawFireMode
- local Increment = 1.5 / (speedAlpha * 0.25)
- local X = 0
- wait(speedAlpha * 0.1)
- while true do
- RS.RenderStepped:wait()
- local newX = X + Increment
- X = (newX > 90 and 90 or newX)
- if prevRawFireMode ~= rawFireMode then break end
- updateModeLabels(rawFireMode - 1, rawFireMode, X)
- if X == 90 then break end
- end
- wait(speedAlpha * 0.25)
- fireSelect.Visible = false
- end)
- end
- if S.selectFireSettings.Animation and (not Aimed) and (not isRunning) and (not isCrawling) then
- spawn(function()
- local sequenceTable = {
- function()
- tweenJoint(RWeld2, nil, CFANG(0, RAD(5), 0), Sine, speedAlpha * 0.15)
- tweenJoint(LWeld, armC0[1], CF(0.1, 1, -0.3) * CFANG(RAD(-7), 0, RAD(-65)), Linear, speedAlpha * 0.15)
- wait(speedAlpha * 0.2)
- end;
- function()
- tweenJoint(LWeld, armC0[1], CF(0.1, 1, -0.3) * CFANG(RAD(-10), 0, RAD(-65)), Linear, speedAlpha * 0.1)
- wait(speedAlpha * 0.2)
- end;
- function()
- tweenJoint(RWeld2, nil, CF(), Sine, speedAlpha * 0.2)
- tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, speedAlpha * 0.2)
- wait(speedAlpha * 0.2)
- end;
- }
- for _, F in pairs(sequenceTable) do
- if Aimed or isRunning or isCrawling or Reloading then
- break
- end
- F()
- end
- end)
- end
- if S.selectFireSettings.Animation or S.selectFireSettings.GUI then
- wait(S.selectFireSettings.animSpeed)
- end
- canSelectFire = true
- end
- end
- if Key == S.Keys.Reload then
- if (not Reloading) and (not isCrawling) then
- Reload()
- end
- end
- if Key == S.Keys.Sprint then
- runKeyPressed = true
- if runReady then
- if (not Idling) and Walking and (not Running) and (not Knifing) and (not (Aimed and S.guiScope and S.Keys.Sprint == S.Keys.scopeSteady)) then
- monitorStamina()
- end
- end
- end
- if Key == S.Keys.scopeSteady then
- steadyKeyPressed = true
- if Aimed and (not Aiming) then
- takingBreath = false
- steadyCamera()
- end
- end
- for _, PTable in pairs(Plugins.KeyDown) do
- if Key == string.lower(PTable.Key) then
- spawn(function()
- PTable.Plugin()
- end)
- end
- end
- end
- function keyUp(K)
- local Key = string.lower(K)
- if Key == S.Keys.ADS then
- if S.aimSettings.holdToADS then
- if (not AimingOut) and Aimed then
- AimingOut = true
- unAimGun()
- AimingOut = false
- end
- end
- end
- if Key == S.Keys.Sprint then
- runKeyPressed = false
- Running = false
- if (not chargingStamina) then
- rechargeStamina()
- end
- end
- if Key == S.Keys.scopeSteady then
- steadyKeyPressed = false
- end
- for _, PTable in pairs(Plugins.KeyUp) do
- if Key == string.lower(PTable.Key) then
- spawn(function()
- PTable.Plugin()
- end)
- end
- end
- end
- --------------------[ END FUNCTIONS ]-------------------------------------------------
- --------------------------------------------------------------------------------------
- --------------------[ PRE-CONNECTIONS ]-----------------------------------------------
- --------------------------------------------------------------------------------------
- local function updateAnimVars()
- wait()
- Forward = (UIS:IsKeyDown("W") or UIS:IsKeyDown("Up"))
- Backward = (UIS:IsKeyDown("S") or UIS:IsKeyDown("Down"))
- local Right = UIS:IsKeyDown("D")
- local Left = UIS:IsKeyDown("A")
- local walkingForward = (Forward and (not Backward))
- local walkingBackward = ((not Forward) and Backward)
- local walkingRight = (Right and (not Left))
- local walkingLeft = ((not Right) and Left)
- if (Forward or Backward or Right or Left) then
- Walking, Idling = true, false
- if (not Running) and (not Aimed) then
- spreadMotion = "Moving"
- baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
- end
- elseif (not (Forward and Backward and Right and Left)) then
- Walking, Idling = false, true
- if (not Aimed) then
- spreadMotion = "Idling"
- baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
- end
- end
- local newArmTilt = (
- ((walkingForward or walkingBackward) and walkingRight) and 2.5 or
- ((walkingForward or walkingBackward) and walkingLeft) and -2.5 or
- ((not (walkingForward and walkingBackward)) and walkingRight) and 5 or
- ((not (walkingForward and walkingBackward)) and walkingLeft) and -5 or 0
- )
- local newMoveAng = (
- (walkingForward and (not (walkingRight or walkingLeft))) and 0 or
- (walkingForward and walkingRight) and RAD(-45) or
- ((not (walkingForward or walkingBackward)) and walkingRight) and RAD(-90) or
- (walkingBackward and walkingRight) and RAD(-135) or
- (walkingBackward and (not (walkingRight or walkingLeft))) and (moveAng < 0 and RAD(-180) or RAD(180)) or
- (walkingBackward and walkingLeft) and RAD(135) or
- ((not (walkingForward or walkingBackward)) and walkingLeft) and RAD(90) or
- (walkingForward and walkingLeft) and RAD(45) or 0
- )
- local newAnimCode = math.random(-1e9, 1e9)
- animCode = newAnimCode
- local startTilt = armTilt
- local startAng = (ABS(moveAng) == RAD(180)) and (newMoveAng > 0 and RAD(180) or RAD(-180)) or moveAng
- local Increment = (startTilt == newArmTilt and 1.5 / 0.7 or 1.5 / (0.35 * ABS(startTilt - newArmTilt) / 5))
- local X = 0
- while true do
- RS.RenderStepped:wait()
- local newX = X + Increment
- X = (newX > 90 and 90 or newX)
- if animCode ~= newAnimCode then break end
- armTilt = numLerp(startTilt, newArmTilt, Sine(X))
- moveAng = numLerp(startAng, newMoveAng, Sine(X))
- if X == 90 then break end
- end
- end
- M2.KeyDown:connect(updateAnimVars)
- M2.KeyUp:connect(updateAnimVars)
- updateAnimVars()
- --------------------------------------------------------------------------------------
- --------------------[ TOOL SELECTION AND DESELECTION ]--------------------------------
- --------------------------------------------------------------------------------------
- function onEquipped()
- wait()
- if Humanoid.Health ~= 0 and (not Selected) and Gun.Parent == Char then
- Selected = true
- breakReload = false
- equipAnimPlaying = true
- math.randomseed(tick()) --This sets a new seed for the random function each time you select the gun
- --------------------[ FAILSAFE RESETING ]-------------------------------------
- for _, GM in pairs(ignoreModel:GetChildren()) do
- if GM.Name == "gunIgnore_"..Player.Name then
- GM:Destroy()
- end
- end
- for _, c in pairs(Connections) do
- c:disconnect()
- end
- Connections = {}
- --------------------[ REMOTE GUN SETUP ]--------------------------------------
- --[[local Vars = {
- ignoreModel = ignoreModel;
- Humanoid = Humanoid;
- Shoulders = Shoulders;
- Torso = Torso;
- Head = Head;
- armC0 = armC0;
- leftArmC1 = S.equipSettings.leftArmC1;
- rightArmC1 = S.equipSettings.rightArmC1;
- LArm = LArm;
- RArm = RArm;
- gunParts = gunParts;
- Handle = Handle;
- }
- gunIgnore, playerFolder, headWeld, headWeld2, animWeld, ABWeld, LWeld, RWeld, LWeld2, RWeld2, LLegWeld, RLegWeld, gunParts2 = gunSetup:InvokeServer(Vars)]]
- --------------------[ CREATING IGNORE MODELS ]--------------------------------
- gunIgnore = Instance.new("Model")
- gunIgnore.Name = "gunIgnore_"..Player.Name
- gunIgnore.Parent = ignoreModel
- --------------------[ MODIFYING THE PLAYER ]----------------------------------
- Player.CameraMode = Enum.CameraMode.LockFirstPerson
- Cam.CameraType = Enum.CameraType.Scriptable
- Cam.FieldOfView = 80
- UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
- UIS.MouseIconEnabled = false
- local initialX, initialY = getYawPitch(Cam.CoordinateFrame)
- camAng = -VEC2(initialX, initialY)
- mainGUI.Parent = Player.PlayerGui
- setUpGUI()
- updateHealth()
- if S.selectFire then
- local currentMode = Modes[((rawFireMode - 1) % numModes) + 1]
- if currentMode == "AUTO" then
- fireFunction = autoFire
- elseif currentMode == "BURST" then
- fireFunction = burstFire
- elseif currentMode == "SEMI" then
- fireFunction = semiFire
- else
- fireFunction = nil
- end
- else
- if S.gunType.Semi then
- fireFunction = semiFire
- elseif S.gunType.Auto then
- fireFunction = autoFire
- elseif S.gunType.Burst then
- fireFunction = burstFire
- else
- fireFunction = nil
- end
- end
- changePlayerTrans(Char, 1)
- Humanoid.AutoRotate = false
- Shoulders.Right.Part1 = nil
- Shoulders.Left.Part1 = nil
- playerFolder = Instance.new("Model")
- playerFolder.Name = "playerFolder"
- playerFolder.Parent = gunIgnore
- local headBase = Instance.new("Part")
- headBase.Transparency = 1
- headBase.Name = "headBase"
- headBase.CanCollide = false
- headBase.FormFactor = Enum.FormFactor.Custom
- headBase.Size = V3(0.2, 0.2, 0.2)
- headBase.BottomSurface = Enum.SurfaceType.Smooth
- headBase.TopSurface = Enum.SurfaceType.Smooth
- headBase.Parent = playerFolder
- headWeld = Instance.new("Weld")
- headWeld.Part0 = Torso
- headWeld.Part1 = headBase
- headWeld.C0 = CF(0, 1.5, 0)
- headWeld.Parent = Torso
- headWeld2 = Instance.new("Weld")
- headWeld2.Part0 = headBase
- headWeld2.Part1 = Head
- headWeld2.Parent = headBase
- neckClone = Neck:Clone()
- --[[local stanceBase = Instance.new("Part")
- stanceBase.Transparency = 1
- stanceBase.Name = "stanceBase"
- stanceBase.CanCollide = false
- stanceBase.FormFactor = Enum.FormFactor.Custom
- stanceBase.Size = V3(0.2, 0.2, 0.2)
- stanceBase.BottomSurface = Enum.SurfaceType.Smooth
- stanceBase.TopSurface = Enum.SurfaceType.Smooth
- stanceBase.Parent = playerFolder
- stanceWeld = Instance.new("Weld")
- stanceWeld.Part0 = stanceBase
- stanceWeld.Part1 = Torso
- stanceWeld.Parent = stanceBase]]
- local animBase = Instance.new("Part")
- animBase.Transparency = 1
- animBase.Name = "animBase"
- animBase.CanCollide = false
- animBase.FormFactor = Enum.FormFactor.Custom
- animBase.Size = V3(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 = headBase
- animWeld.Parent = animBase
- local ArmBase = Instance.new("Part")
- ArmBase.Transparency = 1
- ArmBase.Name = "ArmBase"
- ArmBase.CanCollide = false
- ArmBase.FormFactor = Enum.FormFactor.Custom
- ArmBase.Size = V3(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 = V3(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 = V3(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.equipSettings.leftArmC1
- LWeld.Parent = ArmBase
- RWeld = Instance.new("Weld")
- RWeld.Name = "RWeld"
- RWeld.Part0 = ArmBase
- RWeld.Part1 = RArmBase
- RWeld.C0 = armC0[2]
- RWeld.C1 = S.equipSettings.rightArmC1
- 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
- LLegWeld = Instance.new("Weld")
- LLegWeld.Name = "LLegWeld"
- LLegWeld.Part0 = Torso
- LLegWeld.Part1 = nil
- LLegWeld.C0 = CF(-0.5, -2, 0)
- LLegWeld.Parent = Torso
- RLegWeld = Instance.new("Weld")
- RLegWeld.Name = "RLegWeld"
- RLegWeld.Part0 = Torso
- RLegWeld.Part1 = nil
- RLegWeld.C0 = CF(0.5, -2, 0)
- RLegWeld.Parent = Torso
- if S.playerArms then
- armModel = Instance.new("Model", workspace.FilteringEnabled and playerFolder or Cam)
- fakeLArm = LArm:Clone()
- fakeLArm.Parent = armModel
- fakeLArm.Transparency = S.fakeArmSettings.Transparency
- fakeLArm.CanCollide = false
- fakeLArm.Size = S.fakeArmSettings.armSize
- fakeLArm:BreakJoints()
- --LArm.Transparency = 1
- local fakeLWeld = Instance.new("Weld")
- fakeLWeld.Part0 = fakeLArm
- fakeLWeld.Part1 = LArm
- fakeLWeld.Parent = fakeLArm
- fakeRArm = RArm:Clone()
- fakeRArm.Parent = armModel
- fakeRArm.Transparency = S.fakeArmSettings.Transparency
- fakeRArm.CanCollide = false
- fakeRArm.Size = S.fakeArmSettings.armSize
- fakeRArm:BreakJoints()
- --RArm.Transparency = 1
- local fakeRWeld = Instance.new("Weld")
- fakeRWeld.Part0 = fakeRArm
- fakeRWeld.Part1 = RArm
- fakeRWeld.Parent = fakeRArm
- Instance.new("Humanoid", armModel)
- if S.fakeArmSettings.characterMeshes then
- for _,Obj in pairs(Char:GetChildren()) do
- if Obj:IsA("CharacterMesh") then
- Obj:Clone().Parent = armModel
- end
- end
- end
- for _,Obj in pairs(Char:GetChildren()) do
- if Obj:IsA("Shirt") then
- Obj:Clone().Parent = armModel
- end
- end
- else
- armTable = createArms()
- if workspace.FilteringEnabled then
- armTable[1].Model.Parent = playerFolder
- armTable[2].Model.Parent = playerFolder
- else
- armTable[1].Model.Parent = Cam--playerFolder
- armTable[2].Model.Parent = Cam--playerFolder
- end
- 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(gunParts) 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 = Torso.CFrame * CF(0, 0.5, 0) * armC0[2] * S.aimedC1.rightArm:inverse() * Grip.C0
- local handleOffset = AimPart.CFrame:toObjectSpace(Handle.CFrame)
- aimedGripCF = ((Torso.CFrame * CF(headOffset.X, headOffset.Y, 0)) * handleOffset):toObjectSpace(handleCF)
- Grip.C1 = S.equipSettings.GripC1
- --------------------[ RUNNING PLUGINS ]---------------------------------------
- for _, Plugin in pairs(Plugins.OnEquipped) do
- spawn(function()
- Plugin()
- end)
- end
- --------------------[ GETTING PLAYER MASS ]-----------------------------------
- local connectedParts = HRP:GetConnectedParts(true)
- for _, v in pairs(connectedParts) do
- if v:IsA("BasePart") then
- playerMass = playerMass + v:GetMass()
- end
- end
- --------------------[ CONNECTIONS ]-------------------------------------------
- INSERT(Connections, Humanoid.Died:connect(function()
- onUnequipped(true)
- end))
- INSERT(Connections, Humanoid.Jumping:connect(function()
- if Stance ~= 0 then
- Stand()
- end
- end))
- INSERT(Connections, Humanoid.StateChanged:connect(onHumanoidStateChanged))
- INSERT(Connections, Humanoid.HealthChanged:connect(updateHealth))
- INSERT(Connections, M2.Button1Down:connect(onMB1Down))
- INSERT(Connections, M2.Button1Up:connect(onMB1Up))
- INSERT(Connections, M2.Button2Down:connect(onMB2Down))
- INSERT(Connections, M2.Button2Up:connect(onMB2Up))
- INSERT(Connections, M2.KeyDown:connect(keyDown))
- INSERT(Connections, M2.KeyUp:connect(keyUp))
- if S.sensitivitySettings.scrollToChange then
- INSERT(Connections, M2.WheelForward:connect(onScrollUp))
- INSERT(Connections, M2.WheelBackward:connect(onScrollDown))
- end
- if S.AutoKnife then
- INSERT(Connections, RS.Stepped:connect(function()
- local H, P = AdvRayCast(Head.CFrame.p, Head.CFrame.lookVector, S.AutoKnifeDist, nil)
- if H then
- local HitHuman = findFirstClass(H.Parent, "Humanoid")
- if HitHuman and isEnemy(HitHuman) and HitHuman.Health ~= 0 then
- Knife()
- end
- end
- end))
- end
- INSERT(Connections, UIS.InputChanged:connect(function(inputObj)
- if inputObj.UserInputType == Enum.UserInputType.MouseMovement then
- local rawCamAng = camAng - (VEC2(RAD(inputObj.Delta.x), RAD(inputObj.Delta.y)) * mouseSensitivity * 0.25)
- camAng = VEC2(rawCamAng.x, (rawCamAng.y > RAD(80) and RAD(80) or rawCamAng.y < RAD(-80) and RAD(-80) or rawCamAng.y))
- desiredXOffset = math.min(math.max(inputObj.Delta.x, -S.momentumSettings.maxInput), S.momentumSettings.maxInput)
- desiredYOffset = math.min(math.max(inputObj.Delta.y, -S.momentumSettings.maxInput), S.momentumSettings.maxInput)
- end
- end))
- INSERT(Connections, M2.Idle:connect(function(inputObj)
- desiredXOffset = 0
- desiredYOffset = 0
- end))
- INSERT(Connections, RS.Stepped:connect(function()
- 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
- end))
- INSERT(Connections, RS.RenderStepped:connect(function()
- --Main animation
- local animC0, animC1 = getAnimCF()
- animWeld.C0 = animC0
- animWeld.C1 = animC1
- --Camera updating
- renderCamera()
- end))
- --------------------[ ANIMATE GUN ]-------------------------------------------
- tweenJoint(LWeld, nil, S.unAimedC1.leftArm, Sine, S.equipSettings.Time)
- tweenJoint(RWeld, nil, S.unAimedC1.rightArm, Sine, S.equipSettings.Time)
- tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, S.equipSettings.Time)
- spawn(function()
- local T = tick()
- while true do
- if tick() - T > S.equipSettings.Time then break end
- if (not Selected) then break end
- wait()
- end
- equipAnimPlaying = false
- end)
- Animate()
- end
- end
- function onUnequipped(deleteTool)
- if Selected then
- Selected = false
- breakReload = true
- --------------------[ RUNNING PLUGINS ]---------------------------------------
- for _, Plugin in pairs(Plugins.OnUnEquipped) do
- spawn(function()
- Plugin()
- end)
- end
- --------------------[ MODIFYING THE PLAYER ]----------------------------------
- Cam.FieldOfView = 70
- Cam.CameraType = Enum.CameraType.Custom
- UIS.MouseBehavior = Enum.MouseBehavior.Default
- UIS.MouseIconEnabled = true
- Player.CameraMode = Enum.CameraMode.Classic
- if armTable then
- armTable[1].Model:Destroy()
- armTable[2].Model:Destroy()
- elseif armModel then
- armModel:Destroy()
- end
- LLegWeld:Destroy()
- RLegWeld:Destroy()
- changePlayerTrans(Char, 0)
- mainGUI.Parent = script
- Shoulders.Right.Part1 = RArm
- Shoulders.Left.Part1 = LArm
- neckClone.Parent = Torso
- headWeld:Destroy()
- Humanoid.WalkSpeed = 16
- Humanoid.AutoRotate = true
- --------------------[ RESETING THE TOOL ]-------------------------------------
- gunIgnore:Destroy()
- mouseSensitivity = S.sensitivitySettings.Default
- MB1Down = false
- playerMass = 0
- Aimed = false
- camOffsets = {
- guiScope = {
- Rot = V3();
- };
- Reload = {
- Rot = V3();
- Code = nil;
- };
- Recoil = {
- Rot = V3();
- Code = nil;
- };
- }
- recoilAnim = {
- Pos = V3();
- Rot = V3();
- Code = nil;
- }
- --Setting the aim variables to unaimed
- spreadZoom = "unAimed"
- scopeMain.Visible = false
- scopeSteady.Visible = false
- aimAlpha = 0
- aimHeadOffset = 0
- jumpAnimMultiplier = 1
- translationDivisor = 7
- rotationMultiplier = S.momentumSettings.Amplitude.unAimed
- armTiltMultiplier = 1
- Scope.BackgroundTransparency = 1
- if S.guiScope then
- spawn(function()
- for _, Obj in pairs(Gun:GetChildren()) do
- if Obj:IsA("BasePart") then
- Obj.LocalTransparencyModifier = 0
- end
- end
- end)
- end
- onGround = true
- for _, Tab in pairs(gunParts) do
- Tab.Weld:Destroy()
- Tab.Weld = nil
- end
- for _,c in pairs(Connections) do
- c:disconnect()
- end
- Connections = {}
- if deleteTool then
- Cam:ClearAllChildren()
- Gun:Destroy()
- end
- wait() --This is here in case you dolphin dived and deselected the tool instantly
- if S.stanceSettings.standOnDeselect and Stance ~= 0 then
- crawlCamRot = 0
- isCrawling = false
- stanceSway = 1
- spreadStance = "Stand"
- Stand(true)
- end
- baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
- end
- end
- Gun.Equipped:connect(onEquipped)
- Gun.Unequipped:connect(function() onUnequipped(false) end)
- --------------------------------------------------------------------------------------
- --------------------[ END PROGRAM ]---------------------------------------------------
- --------------------------------------------------------------------------------------
- end))IntValue31.Name = "ignoreCode"
- IntValue31.Parent = LocalScript30
- Folder32.Name = "Server_Scripts"
- Folder32.Parent = LocalScript30
- ScreenGui33.Name = "mainGUI"
- ScreenGui33.Parent = LocalScript30
- Frame34.Name = "HUD"
- Frame34.Parent = ScreenGui33
- Frame34.Transparency = 1
- Frame34.Size = UDim2.new(0, 160, 0, 160)
- Frame34.Position = UDim2.new(1, -160, 1, -140)
- Frame34.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame34.BackgroundTransparency = 1
- Frame35.Name = "Ammo"
- Frame35.Parent = Frame34
- Frame35.Transparency = 1
- Frame35.Size = UDim2.new(0, 135, 0, 40)
- Frame35.Position = UDim2.new(0, 5, 0, 60)
- Frame35.BackgroundTransparency = 1
- Frame35.ZIndex = 10
- TextLabel36.Name = "Slash"
- TextLabel36.Parent = Frame35
- TextLabel36.Transparency = 1
- TextLabel36.Size = UDim2.new(0, 0, 0, 45)
- TextLabel36.Text = "/"
- TextLabel36.Position = UDim2.new(0, 92, 0, -12)
- TextLabel36.Visible = false
- TextLabel36.BackgroundTransparency = 1
- TextLabel36.ZIndex = 10
- TextLabel36.Font = Enum.Font.SciFi
- TextLabel36.FontSize = Enum.FontSize.Size24
- TextLabel36.TextColor3 = Color3.new(1, 1, 1)
- TextLabel37.Name = "Stored"
- TextLabel37.Parent = Frame35
- TextLabel37.Transparency = 1
- TextLabel37.Size = UDim2.new(1, 0, 0, 85)
- TextLabel37.Text = "999"
- TextLabel37.Position = UDim2.new(0, 100, 0, -35)
- TextLabel37.Visible = false
- TextLabel37.BackgroundTransparency = 1
- TextLabel37.ZIndex = 10
- TextLabel37.Font = Enum.Font.Code
- TextLabel37.FontSize = Enum.FontSize.Size28
- TextLabel37.TextColor3 = Color3.new(1, 1, 1)
- TextLabel37.TextXAlignment = Enum.TextXAlignment.Left
- TextLabel38.Name = "Clip"
- TextLabel38.Parent = Frame35
- TextLabel38.Transparency = 1
- TextLabel38.Size = UDim2.new(0, 85, 1, 0)
- TextLabel38.Text = "999"
- TextLabel38.Position = UDim2.new(0, 32, 0, -5)
- TextLabel38.BackgroundTransparency = 1
- TextLabel38.ZIndex = 10
- TextLabel38.Font = Enum.Font.Code
- TextLabel38.FontSize = Enum.FontSize.Size48
- TextLabel38.TextColor3 = Color3.new(1, 1, 1)
- TextLabel38.TextWrapped = true
- Frame39.Name = "Controls"
- Frame39.Parent = Frame34
- Frame39.Transparency = 0.30000001192093
- Frame39.Size = UDim2.new(1, 0, 0, 120)
- Frame39.Position = UDim2.new(0, 0, 0, -200)
- Frame39.Visible = false
- Frame39.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
- Frame39.BackgroundTransparency = 0.30000001192093
- Frame39.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
- Frame39.BorderSizePixel = 5
- Frame39.ZIndex = 10
- TextLabel40.Name = "Title"
- TextLabel40.Parent = Frame39
- TextLabel40.Transparency = 1
- TextLabel40.Size = UDim2.new(1, 0, 0, 15)
- TextLabel40.Text = "CONTROLS"
- TextLabel40.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel40.BackgroundTransparency = 1
- TextLabel40.ZIndex = 10
- TextLabel40.Font = Enum.Font.SourceSansBold
- TextLabel40.FontSize = Enum.FontSize.Size14
- TextLabel40.TextColor3 = Color3.new(1, 1, 1)
- TextLabel41.Name = "Line"
- TextLabel41.Parent = TextLabel40
- TextLabel41.Size = UDim2.new(1, 0, 0, 2)
- TextLabel41.Text = ""
- TextLabel41.Position = UDim2.new(0, 0, 1, 1)
- TextLabel41.BackgroundColor3 = Color3.new(1, 1, 0)
- TextLabel41.BorderSizePixel = 0
- TextLabel41.ZIndex = 10
- TextLabel41.Font = Enum.Font.SourceSans
- TextLabel41.FontSize = Enum.FontSize.Size14
- Frame42.Name = "Grenades"
- Frame42.Parent = Frame34
- Frame42.Transparency = 1
- Frame42.Size = UDim2.new(0, 175, 0, 25)
- Frame42.Position = UDim2.new(0, 0, 0, 90)
- Frame42.Visible = false
- Frame42.BackgroundTransparency = 1
- Frame42.ZIndex = 10
- Frame43.Name = "Lethals"
- Frame43.Parent = Frame42
- Frame43.Size = UDim2.new(0.5, -2, 1, 0)
- Frame43.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame43.BorderSizePixel = 0
- Frame43.ZIndex = 10
- ImageLabel44.Name = "Icon"
- ImageLabel44.Parent = Frame43
- ImageLabel44.Transparency = 1
- ImageLabel44.Size = UDim2.new(0, 21, 0, 21)
- ImageLabel44.Position = UDim2.new(0, 7, 0, 2)
- ImageLabel44.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel44.BackgroundTransparency = 1
- ImageLabel44.ZIndex = 10
- TextLabel45.Name = "Mult"
- TextLabel45.Parent = Frame43
- TextLabel45.Transparency = 1
- TextLabel45.Size = UDim2.new(0, 20, 1, 0)
- TextLabel45.Text = "X"
- TextLabel45.Position = UDim2.new(0.5, -10, 0, 0)
- TextLabel45.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel45.BackgroundTransparency = 1
- TextLabel45.BorderSizePixel = 0
- TextLabel45.ZIndex = 10
- TextLabel45.Font = Enum.Font.ArialBold
- TextLabel45.FontSize = Enum.FontSize.Size18
- TextLabel45.TextColor3 = Color3.new(0, 0, 0)
- TextLabel46.Name = "Num"
- TextLabel46.Parent = Frame43
- TextLabel46.Transparency = 1
- TextLabel46.Size = UDim2.new(0, 0, 1, 0)
- TextLabel46.Text = "0"
- TextLabel46.Position = UDim2.new(1, -7, 0, 0)
- TextLabel46.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel46.BackgroundTransparency = 1
- TextLabel46.ZIndex = 10
- TextLabel46.Font = Enum.Font.ArialBold
- TextLabel46.FontSize = Enum.FontSize.Size18
- TextLabel46.TextColor3 = Color3.new(0, 0, 0)
- TextLabel46.TextXAlignment = Enum.TextXAlignment.Right
- Frame47.Name = "Tacticals"
- Frame47.Parent = Frame42
- Frame47.Size = UDim2.new(0.5, -2, 1, 0)
- Frame47.Position = UDim2.new(0.5, 2, 0, 0)
- Frame47.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame47.BorderSizePixel = 0
- Frame47.ZIndex = 10
- ImageLabel48.Name = "Icon"
- ImageLabel48.Parent = Frame47
- ImageLabel48.Transparency = 1
- ImageLabel48.Size = UDim2.new(0, 21, 0, 21)
- ImageLabel48.Position = UDim2.new(0, 7, 0, 2)
- ImageLabel48.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel48.BackgroundTransparency = 1
- ImageLabel48.ZIndex = 10
- TextLabel49.Name = "Num"
- TextLabel49.Parent = Frame47
- TextLabel49.Transparency = 1
- TextLabel49.Size = UDim2.new(0, 0, 1, 0)
- TextLabel49.Text = "0"
- TextLabel49.Position = UDim2.new(1, -7, 0, 0)
- TextLabel49.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel49.BackgroundTransparency = 1
- TextLabel49.ZIndex = 10
- TextLabel49.Font = Enum.Font.ArialBold
- TextLabel49.FontSize = Enum.FontSize.Size18
- TextLabel49.TextColor3 = Color3.new(0, 0, 0)
- TextLabel49.TextXAlignment = Enum.TextXAlignment.Right
- TextLabel50.Name = "Mult"
- TextLabel50.Parent = Frame47
- TextLabel50.Transparency = 1
- TextLabel50.Size = UDim2.new(0, 20, 1, 0)
- TextLabel50.Text = "X"
- TextLabel50.Position = UDim2.new(0.5, -10, 0, 0)
- TextLabel50.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel50.BackgroundTransparency = 1
- TextLabel50.BorderSizePixel = 0
- TextLabel50.ZIndex = 10
- TextLabel50.Font = Enum.Font.ArialBold
- TextLabel50.FontSize = Enum.FontSize.Size18
- TextLabel50.TextColor3 = Color3.new(0, 0, 0)
- Frame51.Name = "Health"
- Frame51.Parent = Frame34
- Frame51.Transparency = 1
- Frame51.Size = UDim2.new(0.400000006, 0, 0, 25)
- Frame51.Position = UDim2.new(0, 25, 0, 20)
- Frame51.Visible = false
- Frame51.BackgroundColor3 = Color3.new(0.247059, 0.247059, 0.247059)
- Frame51.BackgroundTransparency = 1
- Frame51.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
- Frame51.BorderSizePixel = 0
- Frame51.ZIndex = 10
- Frame51.Draggable = true
- TextLabel52.Name = "Num"
- TextLabel52.Parent = Frame51
- TextLabel52.Transparency = 1
- TextLabel52.Size = UDim2.new(0, 50, 1, 0)
- TextLabel52.Text = "100%"
- TextLabel52.Position = UDim2.new(1, -50, 0, 0)
- TextLabel52.BackgroundColor3 = Color3.new(0, 0, 0)
- TextLabel52.BackgroundTransparency = 1
- TextLabel52.BorderColor3 = Color3.new(0, 0, 0)
- TextLabel52.BorderSizePixel = 0
- TextLabel52.ZIndex = 10
- TextLabel52.Font = Enum.Font.SourceSansBold
- TextLabel52.FontSize = Enum.FontSize.Size24
- TextLabel52.TextColor3 = Color3.new(1, 1, 1)
- TextLabel52.TextStrokeColor3 = Color3.new(0.745098, 0.745098, 0.745098)
- TextLabel52.TextXAlignment = Enum.TextXAlignment.Right
- Frame53.Name = "Tray"
- Frame53.Parent = Frame51
- Frame53.Transparency = 1
- Frame53.Size = UDim2.new(1, -60, 0, 20)
- Frame53.Position = UDim2.new(0, 2, 0.5, -10)
- Frame53.Visible = false
- Frame53.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame53.BackgroundTransparency = 1
- Frame53.BorderColor3 = Color3.new(0, 0, 0)
- Frame53.BorderSizePixel = 0
- Frame53.ZIndex = 10
- Frame53.ClipsDescendants = true
- Frame54.Name = "Beat"
- Frame54.Parent = Frame53
- Frame54.Transparency = 1
- Frame54.Size = UDim2.new(0, 21, 1, 0)
- Frame54.Position = UDim2.new(1, 0, 0, 0)
- Frame54.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame54.BackgroundTransparency = 1
- Frame54.BorderColor3 = Color3.new(0, 0, 0)
- Frame54.BorderSizePixel = 0
- Frame54.ZIndex = 10
- Frame55.Name = "00"
- Frame55.Parent = Frame54
- Frame55.Size = UDim2.new(0.0476190485, 0, 0, 3)
- Frame55.Position = UDim2.new(0, 0, 0.5, -2)
- Frame55.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame55.BorderColor3 = Color3.new(0, 0, 0)
- Frame55.BorderSizePixel = 0
- Frame55.ZIndex = 10
- Frame56.Name = "01"
- Frame56.Parent = Frame54
- Frame56.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame56.Position = UDim2.new(0.0476190485, 0, 0.423076928, -2)
- Frame56.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame56.BorderColor3 = Color3.new(0, 0, 0)
- Frame56.BorderSizePixel = 0
- Frame56.ZIndex = 10
- Frame57.Name = "02"
- Frame57.Parent = Frame54
- Frame57.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame57.Position = UDim2.new(0.095238097, 0, 0.346153855, -2)
- Frame57.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame57.BorderColor3 = Color3.new(0, 0, 0)
- Frame57.BorderSizePixel = 0
- Frame57.ZIndex = 10
- Frame58.Name = "03"
- Frame58.Parent = Frame54
- Frame58.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame58.Position = UDim2.new(0.142857149, 0, 0.269230783, -2)
- Frame58.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame58.BorderColor3 = Color3.new(0, 0, 0)
- Frame58.BorderSizePixel = 0
- Frame58.ZIndex = 10
- Frame59.Name = "04"
- Frame59.Parent = Frame54
- Frame59.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame59.Position = UDim2.new(0.190476194, 0, 0.192307696, -2)
- Frame59.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame59.BorderColor3 = Color3.new(0, 0, 0)
- Frame59.BorderSizePixel = 0
- Frame59.ZIndex = 10
- Frame60.Name = "05"
- Frame60.Parent = Frame54
- Frame60.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame60.Position = UDim2.new(0.238095239, 0, 0.115384616, -2)
- Frame60.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame60.BorderColor3 = Color3.new(0, 0, 0)
- Frame60.BorderSizePixel = 0
- Frame60.ZIndex = 10
- Frame61.Name = "06"
- Frame61.Parent = Frame54
- Frame61.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame61.Position = UDim2.new(0.285714298, 0, 0.0384615399, -2)
- Frame61.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame61.BorderColor3 = Color3.new(0, 0, 0)
- Frame61.BorderSizePixel = 0
- Frame61.ZIndex = 10
- Frame62.Name = "07"
- Frame62.Parent = Frame54
- Frame62.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame62.Position = UDim2.new(0.333333343, 0, 0, -2)
- Frame62.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame62.BorderColor3 = Color3.new(0, 0, 0)
- Frame62.BorderSizePixel = 0
- Frame62.ZIndex = 10
- Frame63.Name = "08"
- Frame63.Parent = Frame54
- Frame63.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame63.Position = UDim2.new(0.380952388, 0, 0.142857149, -2)
- Frame63.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame63.BorderColor3 = Color3.new(0, 0, 0)
- Frame63.BorderSizePixel = 0
- Frame63.ZIndex = 10
- Frame64.Name = "09"
- Frame64.Parent = Frame54
- Frame64.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame64.Position = UDim2.new(0.428571433, 0, 0.285714298, -2)
- Frame64.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame64.BorderColor3 = Color3.new(0, 0, 0)
- Frame64.BorderSizePixel = 0
- Frame64.ZIndex = 10
- Frame65.Name = "10"
- Frame65.Parent = Frame54
- Frame65.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame65.Position = UDim2.new(0.476190478, 0, 0.428571433, -2)
- Frame65.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame65.BorderColor3 = Color3.new(0, 0, 0)
- Frame65.BorderSizePixel = 0
- Frame65.ZIndex = 10
- Frame66.Name = "11"
- Frame66.Parent = Frame54
- Frame66.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame66.Position = UDim2.new(0.523809552, 0, 0.571428597, -2)
- Frame66.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame66.BorderColor3 = Color3.new(0, 0, 0)
- Frame66.BorderSizePixel = 0
- Frame66.ZIndex = 10
- Frame67.Name = "12"
- Frame67.Parent = Frame54
- Frame67.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame67.Position = UDim2.new(0.571428597, 0, 0.714285731, -2)
- Frame67.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame67.BorderColor3 = Color3.new(0, 0, 0)
- Frame67.BorderSizePixel = 0
- Frame67.ZIndex = 10
- Frame68.Name = "13"
- Frame68.Parent = Frame54
- Frame68.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame68.Position = UDim2.new(0.619047642, 0, 0.857142866, -2)
- Frame68.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame68.BorderColor3 = Color3.new(0, 0, 0)
- Frame68.BorderSizePixel = 0
- Frame68.ZIndex = 10
- Frame69.Name = "14"
- Frame69.Parent = Frame54
- Frame69.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame69.Position = UDim2.new(0.666666687, 0, 0.916666687, -2)
- Frame69.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame69.BorderColor3 = Color3.new(0, 0, 0)
- Frame69.BorderSizePixel = 0
- Frame69.ZIndex = 10
- Frame70.Name = "15"
- Frame70.Parent = Frame54
- Frame70.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame70.Position = UDim2.new(0.714285731, 0, 0.833333313, -2)
- Frame70.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame70.BorderColor3 = Color3.new(0, 0, 0)
- Frame70.BorderSizePixel = 0
- Frame70.ZIndex = 10
- Frame71.Name = "16"
- Frame71.Parent = Frame54
- Frame71.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame71.Position = UDim2.new(0.761904776, 0, 0.75, -2)
- Frame71.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame71.BorderColor3 = Color3.new(0, 0, 0)
- Frame71.BorderSizePixel = 0
- Frame71.ZIndex = 10
- Frame72.Name = "17"
- Frame72.Parent = Frame54
- Frame72.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame72.Position = UDim2.new(0.809523821, 0, 0.666666687, -2)
- Frame72.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame72.BorderColor3 = Color3.new(0, 0, 0)
- Frame72.BorderSizePixel = 0
- Frame72.ZIndex = 10
- Frame73.Name = "18"
- Frame73.Parent = Frame54
- Frame73.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame73.Position = UDim2.new(0.857142866, 0, 0.583333313, -2)
- Frame73.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame73.BorderColor3 = Color3.new(0, 0, 0)
- Frame73.BorderSizePixel = 0
- Frame73.ZIndex = 10
- Frame74.Name = "19"
- Frame74.Parent = Frame54
- Frame74.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame74.Position = UDim2.new(0.90476191, 0, 0.5, -2)
- Frame74.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame74.BorderColor3 = Color3.new(0, 0, 0)
- Frame74.BorderSizePixel = 0
- Frame74.ZIndex = 10
- Frame75.Name = "20"
- Frame75.Parent = Frame54
- Frame75.Size = UDim2.new(0.0476190485, 0, 0, 4)
- Frame75.Position = UDim2.new(0.952000022, 0, 0.49000001, -2)
- Frame75.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame75.BorderColor3 = Color3.new(0, 0, 0)
- Frame75.BorderSizePixel = 0
- Frame75.ZIndex = 10
- Frame76.Name = "Line"
- Frame76.Parent = Frame54
- Frame76.Size = UDim2.new(0, 200, 0, 3)
- Frame76.Position = UDim2.new(1, 0, 0.5, -2)
- Frame76.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame76.BorderColor3 = Color3.new(0, 0, 0)
- Frame76.BorderSizePixel = 0
- Frame76.ZIndex = 10
- Frame77.Name = "Line"
- Frame77.Parent = Frame54
- Frame77.Size = UDim2.new(0, 200, 0, 3)
- Frame77.Position = UDim2.new(0, -200, 0.5, -2)
- Frame77.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame77.BorderColor3 = Color3.new(0, 0, 0)
- Frame77.BorderSizePixel = 0
- Frame77.ZIndex = 10
- Frame78.Name = "Mode"
- Frame78.Parent = Frame34
- Frame78.Transparency = 1
- Frame78.Size = UDim2.new(0, 85, 0, 20)
- Frame78.Position = UDim2.new(0, 37, 1, -70)
- Frame78.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame78.BackgroundTransparency = 1
- Frame78.ZIndex = 10
- TextLabel79.Name = "Bracket"
- TextLabel79.Parent = Frame78
- TextLabel79.Transparency = 1
- TextLabel79.Size = UDim2.new(0, 5, 0, 20)
- TextLabel79.Text = "["
- TextLabel79.BackgroundTransparency = 1
- TextLabel79.ZIndex = 10
- TextLabel79.Font = Enum.Font.ArialBold
- TextLabel79.FontSize = Enum.FontSize.Size18
- TextLabel79.TextColor3 = Color3.new(1, 1, 1)
- TextLabel79.TextXAlignment = Enum.TextXAlignment.Left
- TextLabel80.Name = "Bracket"
- TextLabel80.Parent = Frame78
- TextLabel80.Transparency = 1
- TextLabel80.Size = UDim2.new(0, 5, 0, 20)
- TextLabel80.Text = "]"
- TextLabel80.Position = UDim2.new(1, -5, 0, 0)
- TextLabel80.BackgroundTransparency = 1
- TextLabel80.ZIndex = 10
- TextLabel80.Font = Enum.Font.ArialBold
- TextLabel80.FontSize = Enum.FontSize.Size18
- TextLabel80.TextColor3 = Color3.new(1, 1, 1)
- TextLabel80.TextXAlignment = Enum.TextXAlignment.Left
- TextLabel81.Name = "Main"
- TextLabel81.Parent = Frame78
- TextLabel81.Transparency = 1
- TextLabel81.Size = UDim2.new(1, 0, 0, 20)
- TextLabel81.Text = "Auto"
- TextLabel81.BackgroundTransparency = 1
- TextLabel81.ZIndex = 10
- TextLabel81.Font = Enum.Font.Code
- TextLabel81.FontSize = Enum.FontSize.Size18
- TextLabel81.TextColor3 = Color3.new(1, 1, 1)
- TextLabel81.TextWrapped = true
- Frame82.Name = "gunName"
- Frame82.Parent = Frame34
- Frame82.Transparency = 1
- Frame82.Size = UDim2.new(1, 0, 0, 36)
- Frame82.BackgroundColor3 = Color3.new(0.352941, 0.352941, 0.352941)
- Frame82.BackgroundTransparency = 1
- Frame82.ZIndex = 10
- TextLabel83.Name = "Title"
- TextLabel83.Parent = Frame82
- TextLabel83.Transparency = 1
- TextLabel83.Size = UDim2.new(1, 0, 1, 0)
- TextLabel83.Text = "GUN NAME"
- TextLabel83.Position = UDim2.new(0, 0, 0, 23)
- TextLabel83.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel83.BackgroundTransparency = 1
- TextLabel83.ZIndex = 10
- TextLabel83.Font = Enum.Font.Code
- TextLabel83.FontSize = Enum.FontSize.Size36
- TextLabel83.TextColor3 = Color3.new(1, 1, 1)
- TextLabel83.TextScaled = true
- TextLabel83.TextStrokeColor3 = Color3.new(0.745098, 0.745098, 0.745098)
- TextLabel83.TextWrapped = true
- TextLabel84.Name = "Version"
- TextLabel84.Parent = Frame34
- TextLabel84.Transparency = 1
- TextLabel84.Size = UDim2.new(1, 0, 0, 15)
- TextLabel84.Text = "V0.4 - REMAKE"
- TextLabel84.Position = UDim2.new(1, 10, 1, 0)
- TextLabel84.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel84.BackgroundTransparency = 1
- TextLabel84.ZIndex = 10
- TextLabel84.Font = Enum.Font.ArialBold
- TextLabel84.FontSize = Enum.FontSize.Size14
- TextLabel84.TextColor3 = Color3.new(1, 1, 1)
- TextLabel84.TextStrokeColor3 = Color3.new(0.745098, 0.745098, 0.745098)
- TextLabel84.TextStrokeTransparency = 0.60000002384186
- TextLabel84.TextTransparency = 0.60000002384186
- TextLabel84.TextWrapped = true
- TextLabel84.TextXAlignment = Enum.TextXAlignment.Right
- ImageLabel85.Name = "hitMarker"
- ImageLabel85.Parent = ScreenGui33
- ImageLabel85.Transparency = 1
- ImageLabel85.Size = UDim2.new(0, 26, 0, 26)
- ImageLabel85.Position = UDim2.new(0.5, -13, 0.5, -31)
- ImageLabel85.Visible = false
- ImageLabel85.BackgroundTransparency = 1
- ImageLabel85.ZIndex = 10
- ImageLabel85.Image = "http://www.roblox.com/asset/?id=121173757"
- NumberValue86.Name = "lastMark"
- NumberValue86.Parent = ImageLabel85
- TextLabel87.Name = "Sens"
- TextLabel87.Parent = ScreenGui33
- TextLabel87.Transparency = 1
- TextLabel87.Size = UDim2.new(0, 100, 0, 20)
- TextLabel87.Text = "S: 0.3"
- TextLabel87.Position = UDim2.new(1, -131, 1, -25)
- TextLabel87.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel87.BackgroundTransparency = 1
- TextLabel87.ZIndex = 10
- TextLabel87.Font = Enum.Font.Code
- TextLabel87.FontSize = Enum.FontSize.Size28
- TextLabel87.TextColor3 = Color3.new(1, 1, 1)
- Frame88.Name = "Scope"
- Frame88.Parent = ScreenGui33
- Frame88.Transparency = 1
- Frame88.Size = UDim2.new(1, 0, 1, 36)
- Frame88.Position = UDim2.new(0, 0, 0, -36)
- Frame88.Visible = false
- Frame88.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame88.BackgroundTransparency = 1
- TextLabel89.Name = "Steady"
- TextLabel89.Parent = Frame88
- TextLabel89.Transparency = 1
- TextLabel89.Size = UDim2.new(0, 120, 0, 20)
- TextLabel89.Text = ""
- TextLabel89.Position = UDim2.new(0.5, -60, 0.5, 50)
- TextLabel89.Visible = false
- TextLabel89.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel89.BackgroundTransparency = 1
- TextLabel89.ZIndex = 9
- TextLabel89.Font = Enum.Font.ArialBold
- TextLabel89.FontSize = Enum.FontSize.Size14
- TextLabel89.TextColor3 = Color3.new(1, 1, 0)
- TextLabel89.TextStrokeTransparency = 0
- Frame90.Name = "Main"
- Frame90.Parent = Frame88
- Frame90.Transparency = 1
- Frame90.Size = UDim2.new(1, 0, 1, 0)
- Frame90.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame90.BackgroundTransparency = 1
- ImageLabel91.Name = "ScopeImg2"
- ImageLabel91.Parent = Frame90
- ImageLabel91.Transparency = 1
- ImageLabel91.Size = UDim2.new(0, 20, 0, 20)
- ImageLabel91.Position = UDim2.new(0.5, -10, 0, -10)
- ImageLabel91.BackgroundColor3 = Color3.new(0, 0, 0)
- ImageLabel91.BackgroundTransparency = 1
- ImageLabel91.Image = "http://www.roblox.com/asset/?id=184922644"
- ImageLabel92.Name = "ScopeImg1"
- ImageLabel92.Parent = Frame90
- ImageLabel92.Transparency = 1
- ImageLabel92.Size = UDim2.new(0, 20, 0, 20)
- ImageLabel92.Position = UDim2.new(0.5, -10, 0, -10)
- ImageLabel92.BackgroundColor3 = Color3.new(0, 0, 0)
- ImageLabel92.BackgroundTransparency = 1
- ImageLabel92.Image = "http://www.roblox.com/asset/?id=72002022"
- Frame93.Name = "F2"
- Frame93.Parent = Frame90
- Frame93.Size = UDim2.new(0, 0, 1, 20)
- Frame93.Position = UDim2.new(0, -10, 0, -10)
- Frame93.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame93.BorderColor3 = Color3.new(0, 0, 0)
- Frame93.BorderSizePixel = 0
- Frame94.Name = "F1"
- Frame94.Parent = Frame90
- Frame94.Size = UDim2.new(0, 0, 1, 20)
- Frame94.Position = UDim2.new(0, -10, 0, -10)
- Frame94.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame94.BorderColor3 = Color3.new(0, 0, 0)
- Frame94.BorderSizePixel = 0
- LocalScript95.Name = "Update"
- LocalScript95.Parent = Frame90
- table.insert(cors,sandbox(LocalScript95,function()
- local GUI = script.Parent
- function updateScopeDimension()
- GUI.ScopeImg1.Position = UDim2.new(0.5, -10 - (GUI.AbsoluteSize.y / 2), 0, -10)
- GUI.ScopeImg1.Size = UDim2.new(0, 20 + GUI.AbsoluteSize.y, 0, 20 + GUI.AbsoluteSize.y)
- GUI.ScopeImg2.Position = UDim2.new(0.5, -10 - (GUI.AbsoluteSize.y / 2), 0, -10)
- GUI.ScopeImg2.Size = UDim2.new(0, 20 + GUI.AbsoluteSize.y, 0, 20 + GUI.AbsoluteSize.y)
- GUI.F1.Size = UDim2.new(0, 20 + ((GUI.AbsoluteSize.x - GUI.AbsoluteSize.y) / 2), 1, 20)
- GUI.F2.Size = UDim2.new(0, 20 + ((GUI.AbsoluteSize.x - GUI.AbsoluteSize.y) / 2), 1, 20)
- GUI.F2.Position = UDim2.new(1, -10 - ((GUI.AbsoluteSize.x - GUI.AbsoluteSize.y) / 2), 0, -10)
- end
- wait()
- GUI.Changed:connect(updateScopeDimension)
- updateScopeDimension()
- end))
- Frame96.Name = "fireSelect"
- Frame96.Parent = ScreenGui33
- Frame96.Transparency = 1
- Frame96.Position = UDim2.new(0.5, 0, 0.5, -18)
- Frame96.Visible = false
- Frame96.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame96.BackgroundTransparency = 1
- Frame97.Name = "Modes"
- Frame97.Parent = Frame96
- Frame97.Transparency = 1
- Frame97.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame97.BackgroundTransparency = 1
- ImageLabel98.Name = "Circle"
- ImageLabel98.Parent = Frame96
- ImageLabel98.Transparency = 1
- ImageLabel98.Size = UDim2.new(0, 120, 0, 120)
- ImageLabel98.Position = UDim2.new(0, -60, 0, -60)
- ImageLabel98.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel98.BackgroundTransparency = 1
- ImageLabel98.Image = "http://www.roblox.com/asset/?id=55754953"
- ImageLabel98.ImageTransparency = 0.5
- ImageLabel99.Name = "Arrow"
- ImageLabel99.Parent = Frame96
- ImageLabel99.Transparency = 1
- ImageLabel99.Size = UDim2.new(0, 40, 0, 20)
- ImageLabel99.Position = UDim2.new(0, -20, 0, -140)
- ImageLabel99.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel99.BackgroundTransparency = 1
- ImageLabel99.Image = "http://www.roblox.com/asset/?id=126877530"
- TextLabel100.Name = "Co"
- TextLabel100.Parent = ScreenGui33
- TextLabel100.Transparency = 1
- TextLabel100.Size = UDim2.new(1, 0, 0, 20)
- TextLabel100.Text = "tEhYuM yB ekameR & noisuFobruT yB tiK"
- TextLabel100.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel100.BackgroundTransparency = 1
- TextLabel100.ZIndex = 10
- TextLabel100.Font = Enum.Font.SourceSansItalic
- TextLabel100.FontSize = Enum.FontSize.Size18
- TextLabel100.TextColor3 = Color3.new(1, 1, 1)
- TextLabel100.TextStrokeColor3 = Color3.new(1, 1, 1)
- TextLabel100.TextStrokeTransparency = 0.89999997615814
- TextLabel100.TextTransparency = 0.89999997615814
- Frame101.Name = "crossHair"
- Frame101.Parent = ScreenGui33
- Frame101.Position = UDim2.new(0.5, 0, 0.5, -18)
- Frame101.Visible = false
- Frame101.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame101.BorderColor3 = Color3.new(0, 0, 0)
- Frame101.BorderSizePixel = 0
- ImageLabel102.Parent = Frame101
- ImageLabel102.Transparency = 1
- ImageLabel102.Size = UDim2.new(0, 300, 0, 300)
- ImageLabel102.Position = UDim2.new(0, -150, 0, -150)
- ImageLabel102.Visible = false
- ImageLabel102.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel102.BackgroundTransparency = 1
- ImageLabel102.ZIndex = 2
- ImageLabel102.Image = "http://www.roblox.com/asset/?id=68308747"
- TextLabel103.Name = "Reload"
- TextLabel103.Parent = Frame101
- TextLabel103.Transparency = 1
- TextLabel103.Size = UDim2.new(0, 100, 0, 20)
- TextLabel103.Text = "RELOADING..."
- TextLabel103.Position = UDim2.new(0, -50, 0, 70)
- TextLabel103.Visible = false
- TextLabel103.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel103.BackgroundTransparency = 1
- TextLabel103.ZIndex = 2
- TextLabel103.Font = Enum.Font.SourceSansBold
- TextLabel103.FontSize = Enum.FontSize.Size18
- TextLabel103.TextColor3 = Color3.new(1, 1, 1)
- TextLabel103.TextStrokeTransparency = 0.5
- Frame104.Name = "C"
- Frame104.Parent = Frame101
- Frame104.Transparency = 1
- Frame104.Size = UDim2.new(0, 4, 0, 500)
- Frame104.Position = UDim2.new(0, -2, 0, 0)
- Frame104.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame104.BackgroundTransparency = 1
- Frame104.ClipsDescendants = true
- TextLabel105.Name = "Line"
- TextLabel105.Parent = Frame104
- TextLabel105.Size = UDim2.new(0, 2, 0, 15)
- TextLabel105.Text = ""
- TextLabel105.Position = UDim2.new(0.5, -1, 0, 10)
- TextLabel105.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel105.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
- TextLabel105.Font = Enum.Font.SourceSans
- TextLabel105.FontSize = Enum.FontSize.Size14
- Frame106.Name = "A"
- Frame106.Parent = Frame101
- Frame106.Transparency = 1
- Frame106.Size = UDim2.new(0, 4, 0, 500)
- Frame106.Position = UDim2.new(0, -2, 0, -500)
- Frame106.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame106.BackgroundTransparency = 1
- Frame106.ClipsDescendants = true
- TextLabel107.Name = "Line"
- TextLabel107.Parent = Frame106
- TextLabel107.Size = UDim2.new(0, 2, 0, 15)
- TextLabel107.Text = ""
- TextLabel107.Position = UDim2.new(0.5, -1, 1, -25)
- TextLabel107.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel107.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
- TextLabel107.Font = Enum.Font.SourceSans
- TextLabel107.FontSize = Enum.FontSize.Size14
- Frame108.Name = "B"
- Frame108.Parent = Frame101
- Frame108.Transparency = 1
- Frame108.Size = UDim2.new(0, 500, 0, 4)
- Frame108.Position = UDim2.new(0, 0, 0, -2)
- Frame108.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame108.BackgroundTransparency = 1
- Frame108.ClipsDescendants = true
- TextLabel109.Name = "Line"
- TextLabel109.Parent = Frame108
- TextLabel109.Size = UDim2.new(0, 15, 0, 2)
- TextLabel109.Text = ""
- TextLabel109.Position = UDim2.new(0, 10, 0.5, -1)
- TextLabel109.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel109.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
- TextLabel109.Font = Enum.Font.SourceSans
- TextLabel109.FontSize = Enum.FontSize.Size14
- Frame110.Name = "D"
- Frame110.Parent = Frame101
- Frame110.Transparency = 1
- Frame110.Size = UDim2.new(0, 500, 0, 4)
- Frame110.Position = UDim2.new(0, -500, 0, -2)
- Frame110.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame110.BackgroundTransparency = 1
- Frame110.ClipsDescendants = true
- TextLabel111.Name = "Line"
- TextLabel111.Parent = Frame110
- TextLabel111.Size = UDim2.new(0, 15, 0, 2)
- TextLabel111.Text = ""
- TextLabel111.Position = UDim2.new(1, -25, 0.5, -1)
- TextLabel111.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel111.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
- TextLabel111.Font = Enum.Font.SourceSans
- TextLabel111.FontSize = Enum.FontSize.Size14
- Part112.Name = "Chamber"
- Part112.Parent = Tool0
- Part112.Material = Enum.Material.Metal
- Part112.BrickColor = BrickColor.new("New Yeller")
- Part112.Transparency = 1
- Part112.Anchored = true
- Part112.CanCollide = false
- Part112.FormFactor = Enum.FormFactor.Custom
- Part112.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
- Part112.CFrame = CFrame.new(-5.39271498, 1.00081801, -11.8177719, 1.00000012, -5.27594511e-06, -4.34150097e-05, 5.51381663e-06, 1.00000012, 6.45668479e-07, 4.34150097e-05, -6.45914042e-07, 0.99999994)
- Part112.BottomSurface = Enum.SurfaceType.Smooth
- Part112.TopSurface = Enum.SurfaceType.Smooth
- Part112.Color = Color3.new(1, 1, 0)
- Part112.Position = Vector3.new(-5.39271498, 1.00081801, -11.8177719)
- Part112.Color = Color3.new(1, 1, 0)
- Part113.Name = "Body"
- Part113.Parent = Tool0
- Part113.Material = Enum.Material.Metal
- Part113.BrickColor = BrickColor.new("Fossil")
- Part113.Rotation = Vector3.new(0, 90, 0)
- Part113.Anchored = true
- Part113.CanCollide = false
- Part113.Size = Vector3.new(0.237451479, 1.1281848, 2.06304598)
- Part113.CFrame = CFrame.new(-5.3154068, 0.594125092, -11.8089676, -2.34505023e-07, -1.47133505e-08, 1, 1.58774583e-07, 1, 1.4712441e-08, -1, 1.58774554e-07, -2.34505023e-07)
- Part113.Color = Color3.new(0.623529, 0.631373, 0.67451)
- Part113.Position = Vector3.new(-5.3154068, 0.594125092, -11.8089676)
- Part113.Orientation = Vector3.new(0, 90, 0)
- Part113.Color = Color3.new(0.623529, 0.631373, 0.67451)
- SpecialMesh114.Name = "ConvertedMesh"
- SpecialMesh114.Parent = Part113
- SpecialMesh114.MeshId = "rbxassetid://431258335"
- SpecialMesh114.Scale = Vector3.new(0.00170000002, 0.00170000002, 0.00170000002)
- SpecialMesh114.TextureId = "rbxassetid://431259201"
- SpecialMesh114.MeshType = Enum.MeshType.FileMesh
- SpecialMesh114.Scale = Vector3.new(0.00170000002, 0.00170000002, 0.00170000002)
- Part115.Name = "Bolt"
- Part115.Parent = Tool0
- Part115.Material = Enum.Material.Metal
- Part115.BrickColor = BrickColor.new("Fossil")
- Part115.Rotation = Vector3.new(0, 90, 0)
- Part115.Anchored = true
- Part115.CanCollide = false
- Part115.Size = Vector3.new(0.253319412, 0.381031722, 1.77911174)
- Part115.CFrame = CFrame.new(-5.30200005, 0.930000007, -11.8039999, 5.24254847e-06, -5.57291332e-06, 1, -6.45881926e-07, 1, 5.57291651e-06, -1, -6.45911143e-07, 5.24254483e-06)
- Part115.Color = Color3.new(0.623529, 0.631373, 0.67451)
- Part115.Position = Vector3.new(-5.30200005, 0.930000007, -11.8039999)
- Part115.Orientation = Vector3.new(0, 90, 0)
- Part115.Color = Color3.new(0.623529, 0.631373, 0.67451)
- SpecialMesh116.Name = "ConvertedMesh"
- SpecialMesh116.Parent = Part115
- SpecialMesh116.MeshId = "rbxassetid://431258457"
- SpecialMesh116.Scale = Vector3.new(0.00170000002, 0.00170000002, 0.00170000002)
- SpecialMesh116.TextureId = "rbxassetid://431259201"
- SpecialMesh116.MeshType = Enum.MeshType.FileMesh
- SpecialMesh116.Scale = Vector3.new(0.00170000002, 0.00170000002, 0.00170000002)
- Part117.Name = "BoltBack"
- Part117.Parent = Tool0
- Part117.Material = Enum.Material.Metal
- Part117.BrickColor = BrickColor.new("Fossil")
- Part117.Transparency = 1
- Part117.Rotation = Vector3.new(0, 90, 0)
- Part117.Anchored = true
- Part117.CanCollide = false
- Part117.Size = Vector3.new(0.253319412, 0.381031722, 1.77911174)
- Part117.CFrame = CFrame.new(-5.52199984, 0.930000007, -11.8039999, 5.24254847e-06, -5.57291332e-06, 1, -6.45881926e-07, 1, 5.57291651e-06, -1, -6.45911143e-07, 5.24254483e-06)
- Part117.Color = Color3.new(0.623529, 0.631373, 0.67451)
- Part117.Position = Vector3.new(-5.52199984, 0.930000007, -11.8039999)
- Part117.Orientation = Vector3.new(0, 90, 0)
- Part117.Color = Color3.new(0.623529, 0.631373, 0.67451)
- SpecialMesh118.Name = "ConvertedMesh"
- SpecialMesh118.Parent = Part117
- SpecialMesh118.MeshId = "rbxassetid://431258457"
- SpecialMesh118.Scale = Vector3.new(0.00170000002, 0.00170000002, 0.00170000002)
- SpecialMesh118.TextureId = "rbxassetid://431259201"
- SpecialMesh118.MeshType = Enum.MeshType.FileMesh
- SpecialMesh118.Scale = Vector3.new(0.00170000002, 0.00170000002, 0.00170000002)
- Part119.Name = "Mag"
- Part119.Parent = Tool0
- Part119.Material = Enum.Material.Metal
- Part119.BrickColor = BrickColor.new("Fossil")
- Part119.Rotation = Vector3.new(0, 90, 0)
- Part119.Anchored = true
- Part119.CanCollide = false
- Part119.Size = Vector3.new(0.200000003, 0.811040461, 0.380139858)
- Part119.CFrame = CFrame.new(-5.87300014, 0.430000007, -11.8030005, 5.24254847e-06, -5.57291332e-06, 1, -6.45881926e-07, 1, 5.57291651e-06, -1, -6.45911143e-07, 5.24254483e-06)
- Part119.Color = Color3.new(0.623529, 0.631373, 0.67451)
- Part119.Position = Vector3.new(-5.87300014, 0.430000007, -11.8030005)
- Part119.Orientation = Vector3.new(0, 90, 0)
- Part119.Color = Color3.new(0.623529, 0.631373, 0.67451)
- SpecialMesh120.Name = "ConvertedMesh"
- SpecialMesh120.Parent = Part119
- SpecialMesh120.MeshId = "rbxassetid://431258382"
- SpecialMesh120.Scale = Vector3.new(0.00170000002, 0.00170000002, 0.00170000002)
- SpecialMesh120.TextureId = "rbxassetid://431259201"
- SpecialMesh120.MeshType = Enum.MeshType.FileMesh
- SpecialMesh120.Scale = Vector3.new(0.00170000002, 0.00170000002, 0.00170000002)
- 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
- ---------------------------------------------------------------------
- ---Clothing----------------------------------------------------------
- ---------------------------------------------------------------------
- p = game.Players.LocalPlayer
- char = p.Character
- torso = char.Torso
- head = char.Head
- hum = char.Humanoid
- ypcall(function()
- local shirt = Instance.new("Shirt", char)
- shirt.Name = "Shirt"
- local pants = Instance.new("Pants", char)
- pants.Name = "Pants"
- char.Shirt.ShirtTemplate = "rbxassetid://240664573"
- char.Pants.PantsTemplate = "rbxassetid://178985293"
- torso.BrickColor = BrickColor.new("Nougat")
- head.BrickColor = BrickColor.new("Nougat")
- char["Right Arm"].BrickColor = BrickColor.new("Nougat")
- char["Left Arm"].BrickColor = BrickColor.new("Nougat")
- char["Left Leg"].BrickColor = BrickColor.new("Nougat")
- char["Right Leg"].BrickColor = BrickColor.new("Nougat")
- end)
- -----------------------------------------------------------------------------------------
- ---Chat Function ------------------------------------------------------------------------
- -----------------------------------------------------------------------------------------
- if game.Players.LocalPlayer.PlayerGui:FindFirstChild("hah") then
- game.Players.LocalPlayer.PlayerGui.hah:Destroy()
- end
- local NameGui = Instance.new("ScreenGui")
- local Name = Instance.new("Frame")
- local idk = Instance.new("TextBox")
- local dsa = Instance.new("TextButton")
- local ChatService = game:GetService("Chat")
- NameGui.Name = "hah"
- NameGui.Parent = game.Players.LocalPlayer.PlayerGui
- Name.Name = "haah"
- Name.Parent = NameGui
- Name.BackgroundColor3 = Color3.new(0.235294, 0.235294, 0.235294)
- Name.BorderColor3 = Color3.new(0, 0, 0)
- Name.Position = UDim2.new(0, 0, 0, 0)
- Name.Size = UDim2.new(0.3, 0, 0.05, 0)
- idk.Name = "idk"
- idk.Parent = Name
- idk.BackgroundColor3 = Color3.new(0.235294, 0.235294, 0.235294)
- idk.BorderColor3 = Color3.new(0, 0, 0)
- idk.Size = UDim2.new(1, 0, 1, 0)
- idk.Font = Enum.Font.SciFi
- idk.FontSize = Enum.FontSize.Size14
- idk.Text = "' to chat"
- idk.TextColor3 = Color3.new(1, 1, 1)
- idk.TextScaled = true
- idk.TextStrokeTransparency = 0
- idk.TextWrapped = true
- idk.FocusLost:connect(function(enterPressed)
- if string.len(idk.Text) ~= 0 then
- ChatService:Chat(game.Players.LocalPlayer.Character.Head, idk.Text, "Red")
- end
- idk.Text = "' to chat"
- idk:ReleaseFocus()
- end)
- local Mouse = game.Players.LocalPlayer:GetMouse()
- Mouse.KeyDown:connect(function(Key)
- if Key:lower() == "'" then
- idk:CaptureFocus()
- end
- end)
- --------------------------------------------------------------
- --------------------------------------------------------------
- --------------------------------------------------------------
- --END OF SCRIPT [ENJOY MY SCHOOL SHOOTER]---------------------
- --------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement