-- ModuleScript Weapon (via decompile) local ReplicatedStorage_upv_1 = game:GetService("ReplicatedStorage") local CollectionService_upv_1 = game:GetService("CollectionService") local UserInputService_upv_1 = game:GetService("UserInputService") local Weapon_upv_1 = require(ReplicatedStorage_upv_1.Components.Weapon) local ComponentsManager_upv_1 = require(ReplicatedStorage_upv_1.ComponentsManager) local DynamicCrosshair_upv_1 = require(ReplicatedStorage_upv_1.Components.DynamicCrosshair) local Throwable_upv_1 = require(ReplicatedStorage_upv_1.Components.Throwable) local Config_upv_1 = require(ReplicatedStorage_upv_1:WaitForChild("Config")) local _ = require(ReplicatedStorage_upv_1.Modules.TypeModules.Types) local Utility_upv_1 = require(ReplicatedStorage_upv_1.Modules.Utility) local WeaponSlotResolver_upv_1 = require(ReplicatedStorage_upv_1.Modules.WeaponSlotResolver) local Modules_1 = script.Parent.Parent:WaitForChild("Modules") local WeaponInventoryController_upv_1 = require(Modules_1:WaitForChild("WeaponInventoryController")) local WeaponStateReplicator_upv_1 = require(Modules_1:WaitForChild("WeaponStateReplicator")) local CameraModel_upv_1 = ReplicatedStorage_upv_1:WaitForChild("Components"):WaitForChild("Player"):WaitForChild("CameraModel") local ReplayAudioCue_upv_1 = ReplicatedStorage_upv_1:WaitForChild("GameEvents"):WaitForChild("ReplayAudioCue") local tbl_upv_1 = {Vault = true, ADS = true, Lean = true, ADSRelease = true, Stand = true, Crouch = true, Run = true, Prone = true} local tbl_2 = {} local tbl_upv_3 = {} local tbl_4 = {} tbl_upv_3.__index = tbl_4 function tbl_2.new(a1) --[[ name: new line: 155 upvalues: tbl_upv_3 (copy, index: 1) WeaponStateReplicator_upv_1 (copy, index: 2) ReplicatedStorage_upv_1 (copy, index: 3) WeaponSlotResolver_upv_1 (copy, index: 4) ]] local v1 = setmetatable({}, tbl_upv_3) v1.Player = a1 v1.Camera = workspace.CurrentCamera v1.CameraModel = v1:SetupCameraModel(a1) v1.Animations = v1:SetupAnimations(a1) v1.AimPart = v1.CameraModel.Base v1.CurrentTool = nil v1.CurrentToolID = 0 v1.CurrentState = "Hold" v1.Holster = true v1.Jumping = false v1.QuickAction = false v1.ActionDebounce = false v1.CurrentToolIndex = 0 v1.ADSZoom = 1 v1.SpawnEquipPresentationPending = true v1.ThrowableSnapshot = nil v1.StateFolder = nil v1.StateReplicator = WeaponStateReplicator_upv_1.new(ReplicatedStorage_upv_1.GameEvents, nil) v1.InventoryDisconnect = nil v1.ClientWeaponSystemScript = WeaponSlotResolver_upv_1.ResolveClientWeaponSystem(a1.Character) v1:SetupTools(a1) v1:Died(a1) v1:SetupCrosshair() v1:SetFP(a1) v1:SetReadinessState(false, false, false, false) return v1 end function tbl_4.SetupAnimations(a1, a2) --[[ name: SetupAnimations line: 195 ]] local tbl_5 = {} tbl_5.Client = {} tbl_5.Server = {} for _, value_1 in script.Animations:GetChildren() do for v1, value_2 in value_1:GetChildren() do if value_1.Name == "Client" then tbl_5[value_1.Name][value_2.Name] = a1.CameraModel.Humanoid:LoadAnimation(value_2) continue end if value_1.Name == "Server" then local Character_1 = a2.Character assert(Character_1, "SetupAnimations failed because there is no player character") tbl_5[value_1.Name][value_2.Name] = Character_1.Humanoid:LoadAnimation(value_2) end end end return tbl_5 end local function ResolveSoundCueInstance(a1, a2, a3) --[[ name: ResolveSoundCueInstance line: 215 ]] local Character_2 = a1.Player.Character if not Character_2 then return nil end local v2 = nil local HumanoidRootPart_1 = Character_2:FindFirstChild("HumanoidRootPart") v2 = (not HumanoidRootPart_1) or (HumanoidRootPart_1:FindFirstChild(a2)) if not (v2) and typeof(a3) == "string" and a3 ~= "" then local v3 = Character_2:FindFirstChild(a3, true) local v4 = v3 and (v3:FindFirstChild("Handle", true)) local v5 = v4 and v4:FindFirstChild(a2) or nil v2 = v5 end if not (v2) and a1.CurrentTool and a1.CurrentTool.Model then local v6 = a1.CurrentTool.Model:FindFirstChild("Handle", true) local v5 = (v6 and (v6:FindFirstChild(a2))) or nil v2 = v5 end if not (v2) then for _, value_3 in ipairs(Character_2:GetDescendants()) do if not (value_3:IsA("Sound")) then continue end if value_3.Name == a2 then v2 = value_3 break end end end if v2 and v2:IsA("Sound") then return v2 end return nil end local function EmitReplayAudioCue(a1, a2, a3, a4) --[[ name: EmitReplayAudioCue line: 254 upvalues: tbl_upv_1 (copy, index: 1) ResolveSoundCueInstance (copy, index: 2) ReplayAudioCue_upv_1 (copy, index: 3) ]] if tbl_upv_1[a2] ~= true then return end local v7 = ResolveSoundCueInstance(a1, a2, a4) if not v7 then return end local tbl_6 = {SoundName = 0, Looped = 0, PlaybackSpeed = 0, RollOffMaxDistance = 0, SoundId = 0, Volume = 0, RollOffMinDistance = 0} tbl_6.CueType = a2 tbl_6.IsPlaying = a3 tbl_6.Looped = v7.Looped == true tbl_6.SoundId = v7.SoundId tbl_6.SoundName = v7.Name tbl_6.Volume = v7.Volume tbl_6.PlaybackSpeed = v7.PlaybackSpeed tbl_6.RollOffMinDistance = v7.RollOffMinDistance tbl_6.RollOffMaxDistance = v7.RollOffMaxDistance ReplayAudioCue_upv_1:FireServer(tbl_6) end function tbl_4.SoundCue(a1, a2, a3, a4) --[[ name: SoundCue line: 277 upvalues: EmitReplayAudioCue (copy, index: 1) ]] a1:ServerSoundCue(a2, a3, a4) EmitReplayAudioCue(a1, a2, a3, a4) a1:ClientSoundCue(a2, a3, a4) end function tbl_4.ServerSoundCue(a1, a2, a3, a4) --[[ name: ServerSoundCue line: 283 upvalues: ReplicatedStorage_upv_1 (copy, index: 1) ]] ReplicatedStorage_upv_1.GameEvents.SoundCue:FireServer(a2, a3, a4) end function tbl_4.ClientSoundCue(a1, a2, a3, a4) --[[ name: ClientSoundCue line: 287 upvalues: ResolveSoundCueInstance (copy, index: 1) ]] local v8 = ResolveSoundCueInstance(a1, a2, a4) if not v8 then return end if a3 then v8:Play() else v8:Stop() end end function tbl_4.SetupCameraModel(a1, a2) --[[ name: SetupCameraModel line: 300 upvalues: CameraModel_upv_1 (copy, index: 1) ReplicatedStorage_upv_1 (copy, index: 2) ]] a1.Camera:ClearAllChildren() local u1 = CameraModel_upv_1:Clone() u1.Base.Transparency = 1 u1.Anim.Transparency = 1 u1.Tool.Transparency = 1 u1["Right Hand"].Transparency = 1 u1["Left Hand"].Transparency = 1 u1.TestWeapon:Destroy() pcall( function() --[[ line: 321 upvalues: a2 (copy, index: 1) ReplicatedStorage_upv_1 (copy, index: 2) u1 (copy, index: 3) ]] local PlayerData_1 = a2:FindFirstChild("PlayerData") assert(PlayerData_1, "SetupCameraModel failed because PlayerData is nil") local v9 = a2:WaitForChild("PlayerData"):WaitForChild("Loadout"):FindFirstChild(PlayerData_1.Settings:GetAttribute("LoadoutName")) assert(v9, "SetupCameraModel failed because PlayerLoadout is nil") PlayerData_1 = ReplicatedStorage_upv_1.Items.Head[v9:GetAttribute("Head")]:WaitForChild("Body Colors") u1["Left Arm"].Color = PlayerData_1.LeftArmColor3 u1["Right Arm"].Color = PlayerData_1.RightArmColor3 end ) u1.Parent = a1.Camera a1.ClientHighlight = u1:FindFirstChild("Highlight") return u1 end function tbl_4.ValidateToolAnimations(a1, a2, a3, a4) --[[ name: ValidateToolAnimations line: 348 upvalues: Utility_upv_1 (copy, index: 1) ]] if a2 then if a2.Tool then if a2.Animations then if a2.Animations.Client then if a2.Animations.Server then for _, value_4 in ipairs(a3 or {}) do if a2.Animations.Client[value_4] then continue end warn(Utility_upv_1.warnCustom(("Missing CLIENT animation \"%*\" for %*"):format(value_4, a2.Tool.Name))) return false end for _, value_5 in ipairs(a4 or {}) do if a2.Animations.Server[value_5] then continue end warn(Utility_upv_1.warnCustom(("Missing SERVER animation \"%*\" for %*"):format(value_5, a2.Tool.Name))) return false end return true end warn(Utility_upv_1.warnCustom(("ValidateToolAnimations failed because %* has no Server animations table"):format(a2.Tool.Name))) else warn(Utility_upv_1.warnCustom(("ValidateToolAnimations failed because %* has no Client animations table"):format(a2.Tool.Name))) end else warn(Utility_upv_1.warnCustom(("ValidateToolAnimations failed because %* has no Animations table"):format(a2.Tool.Name))) end else warn(Utility_upv_1.warnCustom("ValidateToolAnimations failed because ToolData.Tool is nil")) end else warn(Utility_upv_1.warnCustom("ValidateToolAnimations failed because ToolData is nil")) end return false end function tbl_4.SetupToolAnimations(a1, a2, a3) --[[ name: SetupToolAnimations line: 397 upvalues: Utility_upv_1 (copy, index: 1) ReplicatedStorage_upv_1 (copy, index: 2) Config_upv_1 (copy, index: 3) Throwable_upv_1 (copy, index: 4) ]] local tbl_7 = {} tbl_7.Client = {} tbl_7.Server = {} if a3 then local CameraModel_2 = a1.CameraModel and (a1.CameraModel:FindFirstChildOfClass("Humanoid")) if CameraModel_2 then local Character_3 = a2.Character if Character_3 then local v10 = Character_3:FindFirstChildOfClass("Humanoid") if v10 then local v11 = nil for _, value_6 in ipairs(a3:GetChildren()) do if value_6.Name == "Client" then for v29, value_7 in ipairs(value_6:GetChildren()) do if not (value_7:IsA("Animation")) then warn(Utility_upv_1.warnCustom(("Ignoring non-animation object inside animation folder: %*"):format(value_7:GetFullName()))) continue end if value_6.Name ~= "Client" then v11 = v10:LoadAnimation(value_7) tbl_7.Server[value_7.Name] = v11 else v11 = CameraModel_2:LoadAnimation(value_7) tbl_7.Client[value_7.Name] = v11 end if value_6.Name ~= "Client" then continue end if value_7.Name == "Reload" then v11:GetMarkerReachedSignal("MagOut"):Connect( function() --[[ line: 450 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v12 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v13 = v12 and (v12:FindFirstChild("MagOut")) if v13 then v13:Play() a1:ServerSoundCue("MagOut", true, a1.CurrentTool.Model.Name) end else warn("Failed to MagOut because no CurrentTool exists") end end ) v11:GetMarkerReachedSignal("MagIn"):Connect( function() --[[ line: 462 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v14 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v15 = v14 and (v14:FindFirstChild("MagIn")) if v15 then v15:Play() a1:ServerSoundCue("MagIn", true, a1.CurrentTool.Model.Name) end else warn("Failed to MagIn because no CurrentTool exists") end end ) v11:GetMarkerReachedSignal("Insert"):Connect( function() --[[ line: 474 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v16 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v17 = v16 and (v16:FindFirstChild("Insert")) if v17 then v17:Play() a1:ServerSoundCue("Insert", true, a1.CurrentTool.Model.Name) end else warn("Failed to Insert because no CurrentTool exists") end end ) v11:GetMarkerReachedSignal("Reload"):Connect( function() --[[ line: 486 upvalues: a1 (copy, index: 1) ReplicatedStorage_upv_1 (copy, index: 2) ]] if a1.CurrentTool then if a1.CurrentTool.ReloadCancel == false then ReplicatedStorage_upv_1.GameEvents.Reload:FireServer(a1.CurrentTool.Model.Name) end else warn("Failed to Reload because no CurrentTool exists") end end ) v11:GetMarkerReachedSignal("ShellInsert"):Connect( function() --[[ line: 494 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v18 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v19 = v18 and (v18:FindFirstChild("ShellInsert")) if v19 then v19:Play() a1:ServerSoundCue("ShellInsert", true, a1.CurrentTool.Model.Name) end else warn("Failed to ShellInsert because no CurrentTool exists") end end ) continue end if value_7.Name == "Action" then v11:GetMarkerReachedSignal("Throw"):Connect( function() --[[ line: 507 upvalues: a1 (copy, index: 1) Config_upv_1 (copy, index: 2) Throwable_upv_1 (copy, index: 3) ReplicatedStorage_upv_1 (copy, index: 4) ]] if a1.CurrentTool then Config_upv_1.AddSound("Knife_Swing", nil, true, game.SoundService, false) a1:ToggleToolModelVisible(a1.CurrentTool.Model, false) local v20 = a1.ThrowableSnapshot if not (v20) then local Character_4 = a1.Player.Character local v21 = Character_4 and (Throwable_upv_1.BuildClientThrowData(Character_4, a1.Camera, a1.Player.PlayerGui.Crosshair, a1.CurrentTool.Model, {Character_4, a1.Camera, a1.CameraModel, a1.CurrentTool.Model})) if v21 then local tbl_8 = {ThrowData = 0, StartPosition = 0, ViewDirection = 0} tbl_8.ToolName = a1.CurrentTool.Tool.Name tbl_8.CameraPosition = v21.CameraPosition tbl_8.ViewDirection = v21.ViewDirection or (v21.Direction) tbl_8.StartPosition = v21.Origin tbl_8.ThrowData = v21 a1.ThrowableSnapshot = tbl_8 v20 = tbl_8 end end if v20 then ReplicatedStorage_upv_1.GameEvents.Tactical:FireServer(v20.ToolName, v20.ViewDirection, v20.CameraPosition, v20.StartPosition, "Throwable") end else warn("Failed to Throw because no CurrentTool exists") end end ) continue end if value_7.Name == "Bolt" then v11:GetMarkerReachedSignal("Pull"):Connect( function() --[[ line: 545 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v22 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v23 = v22 and (v22:FindFirstChild("Pull")) if v23 then v23:Play() a1:ServerSoundCue("Pull", true, a1.CurrentTool.Model.Name) end else warn("Failed to Pull because no CurrentTool exists") end end ) v11:GetMarkerReachedSignal("Push"):Connect( function() --[[ line: 557 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v24 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v25 = v24 and (v24:FindFirstChild("Push")) if v25 then v25:Play() a1:ServerSoundCue("Push", true, a1.CurrentTool.Model.Name) end else warn("Failed to Push because no CurrentTool exists") end end ) continue end if value_7.Name == "Pump" then v11:GetMarkerReachedSignal("Pull"):Connect( function() --[[ line: 570 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v26 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v27 = v26 and (v26:FindFirstChild("Pull")) if v27 then v27:Play() a1:ServerSoundCue("Pull", true, a1.CurrentTool.Model.Name) end else warn("Failed to Pull-2 because no CurrentTool exists") end end ) end end else if value_6.Name ~= "Server" then warn(Utility_upv_1.warnCustom(("Ignoring unknown animation folder: %*"):format(value_6:GetFullName()))) continue end for v29, value_7 in ipairs(value_6:GetChildren()) do if not (value_7:IsA("Animation")) then warn(Utility_upv_1.warnCustom(("Ignoring non-animation object inside animation folder: %*"):format(value_7:GetFullName()))) continue end if value_6.Name ~= "Client" then local v28 = v10:LoadAnimation(value_7) tbl_7.Server[value_7.Name] = v28 v11 = v28 else v11 = CameraModel_2:LoadAnimation(value_7) tbl_7.Client[value_7.Name] = v11 end if value_6.Name ~= "Client" then continue end if value_7.Name == "Reload" then v11:GetMarkerReachedSignal("MagOut"):Connect( function() --[[ line: 450 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v12 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v13 = v12 and (v12:FindFirstChild("MagOut")) if v13 then v13:Play() a1:ServerSoundCue("MagOut", true, a1.CurrentTool.Model.Name) end else warn("Failed to MagOut because no CurrentTool exists") end end ) v11:GetMarkerReachedSignal("MagIn"):Connect( function() --[[ line: 462 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v14 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v15 = v14 and (v14:FindFirstChild("MagIn")) if v15 then v15:Play() a1:ServerSoundCue("MagIn", true, a1.CurrentTool.Model.Name) end else warn("Failed to MagIn because no CurrentTool exists") end end ) v11:GetMarkerReachedSignal("Insert"):Connect( function() --[[ line: 474 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v16 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v17 = v16 and (v16:FindFirstChild("Insert")) if v17 then v17:Play() a1:ServerSoundCue("Insert", true, a1.CurrentTool.Model.Name) end else warn("Failed to Insert because no CurrentTool exists") end end ) v11:GetMarkerReachedSignal("Reload"):Connect( function() --[[ line: 486 upvalues: a1 (copy, index: 1) ReplicatedStorage_upv_1 (copy, index: 2) ]] if a1.CurrentTool then if a1.CurrentTool.ReloadCancel == false then ReplicatedStorage_upv_1.GameEvents.Reload:FireServer(a1.CurrentTool.Model.Name) end else warn("Failed to Reload because no CurrentTool exists") end end ) v11:GetMarkerReachedSignal("ShellInsert"):Connect( function() --[[ line: 494 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v18 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v19 = v18 and (v18:FindFirstChild("ShellInsert")) if v19 then v19:Play() a1:ServerSoundCue("ShellInsert", true, a1.CurrentTool.Model.Name) end else warn("Failed to ShellInsert because no CurrentTool exists") end end ) continue end if value_7.Name == "Action" then v11:GetMarkerReachedSignal("Throw"):Connect( function() --[[ line: 507 upvalues: a1 (copy, index: 1) Config_upv_1 (copy, index: 2) Throwable_upv_1 (copy, index: 3) ReplicatedStorage_upv_1 (copy, index: 4) ]] if a1.CurrentTool then Config_upv_1.AddSound("Knife_Swing", nil, true, game.SoundService, false) a1:ToggleToolModelVisible(a1.CurrentTool.Model, false) local v20 = a1.ThrowableSnapshot if not (v20) then local Character_4 = a1.Player.Character local v21 = Character_4 and (Throwable_upv_1.BuildClientThrowData(Character_4, a1.Camera, a1.Player.PlayerGui.Crosshair, a1.CurrentTool.Model, {Character_4, a1.Camera, a1.CameraModel, a1.CurrentTool.Model})) if v21 then local tbl_8 = {ThrowData = 0, StartPosition = 0, ViewDirection = 0} tbl_8.ToolName = a1.CurrentTool.Tool.Name tbl_8.CameraPosition = v21.CameraPosition tbl_8.ViewDirection = v21.ViewDirection or (v21.Direction) tbl_8.StartPosition = v21.Origin tbl_8.ThrowData = v21 a1.ThrowableSnapshot = tbl_8 v20 = tbl_8 end end if v20 then ReplicatedStorage_upv_1.GameEvents.Tactical:FireServer(v20.ToolName, v20.ViewDirection, v20.CameraPosition, v20.StartPosition, "Throwable") end else warn("Failed to Throw because no CurrentTool exists") end end ) continue end if value_7.Name == "Bolt" then v11:GetMarkerReachedSignal("Pull"):Connect( function() --[[ line: 545 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v22 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v23 = v22 and (v22:FindFirstChild("Pull")) if v23 then v23:Play() a1:ServerSoundCue("Pull", true, a1.CurrentTool.Model.Name) end else warn("Failed to Pull because no CurrentTool exists") end end ) v11:GetMarkerReachedSignal("Push"):Connect( function() --[[ line: 557 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v24 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v25 = v24 and (v24:FindFirstChild("Push")) if v25 then v25:Play() a1:ServerSoundCue("Push", true, a1.CurrentTool.Model.Name) end else warn("Failed to Push because no CurrentTool exists") end end ) continue end if value_7.Name == "Pump" then v11:GetMarkerReachedSignal("Pull"):Connect( function() --[[ line: 570 upvalues: a1 (copy, index: 1) ]] if a1.CurrentTool then local v26 = a1.CurrentTool.Model and (a1.CurrentTool.Model:FindFirstChild("Handle")) local v27 = v26 and (v26:FindFirstChild("Pull")) if v27 then v27:Play() a1:ServerSoundCue("Pull", true, a1.CurrentTool.Model.Name) end else warn("Failed to Pull-2 because no CurrentTool exists") end end ) end end end end else warn(Utility_upv_1.warnCustom("SetupToolAnimations failed because character Humanoid is missing")) end else warn(Utility_upv_1.warnCustom("SetupToolAnimations failed because player character is missing")) end else warn(Utility_upv_1.warnCustom("SetupToolAnimations failed because CameraModel Humanoid is missing")) end else warn(Utility_upv_1.warnCustom("SetupToolAnimations failed because toolAnimationFolder is nil")) end return tbl_7 end function tbl_4.GetClassFromIndex(a1, a2) --[[ name: GetClassFromIndex line: 589 ]] if a2 ~= 1 then if a2 ~= 2 then if a2 ~= 3 then if a2 ~= 4 then return nil end return "Throwable" end return "Knife" end return "Secondary" end return "Primary" end function tbl_4.GetStateFolder(a1) --[[ name: GetStateFolder line: 603 upvalues: WeaponSlotResolver_upv_1 (copy, index: 1) ]] local Character_5 = a1.Player.Character a1.StateFolder = Character_5 and WeaponSlotResolver_upv_1.GetStateFolder(Character_5) or nil if a1.StateReplicator then a1.StateReplicator:SetStateFolder(a1.StateFolder) end return a1.StateFolder end function tbl_4.GetClientWeaponSystemScript(a1) --[[ name: GetClientWeaponSystemScript line: 612 upvalues: WeaponSlotResolver_upv_1 (copy, index: 1) ]] a1.ClientWeaponSystemScript = WeaponSlotResolver_upv_1.ResolveClientWeaponSystem(a1.Player.Character) return a1.ClientWeaponSystemScript end function tbl_4.SetReadinessState(a1, a2, a3, a4, a5) --[[ name: SetReadinessState line: 618 upvalues: WeaponSlotResolver_upv_1 (copy, index: 1) ]] local v30 = a1:GetClientWeaponSystemScript() if v30 then v30:SetAttribute("SwapInProgress", a2) v30:SetAttribute("WeaponPresentationReady", a3) v30:SetAttribute("WeaponFullyReady", a4) v30:SetAttribute("WeaponReady", a4) if a5 ~= nil then v30:SetAttribute("InitialEquipReady", a5) end end WeaponSlotResolver_upv_1.UpdateStateFolder(a1:GetStateFolder(), {SwapInProgress = a2, WeaponPresentationReady = a3, WeaponFullyReady = a4, WeaponReady = a4, InitialEquipReady = a5}) end function tbl_4.IsWeaponPresentationReady(a1) --[[ name: IsWeaponPresentationReady line: 639 ]] local v31 = a1:GetClientWeaponSystemScript() if not v31 then return false end local v32 = v31:GetAttribute("WeaponPresentationReady") == true return v32 end function tbl_4.IsWeaponReady(a1) --[[ name: IsWeaponReady line: 647 ]] local v33 = a1:GetClientWeaponSystemScript() if not v33 then return false end local v34 = (v33:GetAttribute("SwapInProgress") ~= true) and (v33:GetAttribute("WeaponFullyReady") == true) return v34 end function tbl_4.ResetWeaponPresentationState(a1, a2) --[[ name: ResetWeaponPresentationState line: 655 ]] if not a2 then return end a1.CurrentState = "Hold" if a2.Aiming ~= nil then a2.Aiming = false end if a2.ReloadCancel ~= nil then a2.ReloadCancel = false end if a2.Reloading ~= nil then a2.Reloading = false end if a2.Bolting ~= nil then a2.Bolting = false end if a2.Pumping ~= nil then a2.Pumping = false end if a2.SemiCooldown ~= nil then a2.SemiCooldown = false end if a2.Settings and a2.Settings.SightFront then a2.Settings.SightFront.Transparency = 0 end if a1.Crosshair then a1.Crosshair:Enable() end local PlayerGui_1 = a1.Player:FindFirstChild("PlayerGui") local v35 = PlayerGui_1 and (PlayerGui_1:FindFirstChild("GameHUD")) local v36 = v35 and (v35:FindFirstChild("ScopeUI")) if (not v36 or not v36:IsA("ScreenGui")) and v35 and v35:IsA("GuiObject") then v35.Visible = false end v36.Visible = false end function tbl_4.GetCrosshairPresentationState(a1) --[[ name: GetCrosshairPresentationState line: 696 ]] local v37 = "Dot" local v38 = 3 local v39 = 3 local v40 = 0 local v41 = false if a1.Crosshair then v38 = a1.Crosshair.SizeX or v38 v39 = a1.Crosshair.SizeY or v39 v40 = tonumber(a1.Crosshair.Spreading.MinSpread) or v40 v41 = a1.Crosshair.FollowingMouse == true end if a1.CurrentTool and a1.CurrentTool.Tool and a1.CurrentTool.Tool:GetAttribute("Class") == "Throwable" then v37 = "Throwable" elseif a1.CurrentTool then v37 = ((a1.CurrentTool.CrosshairSpread) and "Gun") or v37 end local tbl_9 = {} tbl_9.CrosshairStyle = v37 tbl_9.CrosshairSizeX = v38 tbl_9.CrosshairSizeY = v39 tbl_9.CrosshairMinSpread = v40 tbl_9.CrosshairFollowMouse = v41 return tbl_9 end function tbl_4.PushRuntimeState(a1, a2, a3) --[[ name: PushRuntimeState line: 725 ]] if not a1.StateReplicator then return end local v42 = a3 or {} for key_1, value_8 in pairs(a1:GetCrosshairPresentationState()) do if v42[key_1] == nil then v42[key_1] = value_8 end end a1:GetStateFolder() a1.StateReplicator:SendActionState(a2, v42) end function tbl_4.SendEquipRequest(a1, a2, a3) --[[ name: SendEquipRequest line: 741 upvalues: ReplicatedStorage_upv_1 (copy, index: 1) WeaponSlotResolver_upv_1 (copy, index: 2) ]] if a1.StateReplicator then a1:GetStateFolder() a1.StateReplicator:SendEquipRequest(a2, WeaponSlotResolver_upv_1.GetOrAssignToolSerial(a3), a3.Name) else ReplicatedStorage_upv_1.GameEvents.SwapWeapon:FireServer(a3.Name) end end function tbl_4.ConfirmServerEquip(a1, a2) --[[ name: ConfirmServerEquip line: 752 ]] if not a1.StateReplicator then return end a1:GetStateFolder() a1.StateReplicator:ConfirmEquip(a2) end function tbl_4.RejectPendingEquip(a1, a2) --[[ name: RejectPendingEquip line: 761 ]] if not a1.StateReplicator then return end a1:GetStateFolder() a1.StateReplicator:RejectPendingEquip(a2) end function tbl_4.BuildPresentationEventContext(a1, a2) --[[ name: BuildPresentationEventContext line: 770 upvalues: WeaponSlotResolver_upv_1 (copy, index: 1) ]] local CurrentTool_1 = a1.CurrentTool local v43 = (CurrentTool_1 and (CurrentTool_1.Tool)) or nil local v44 = (v43) and (WeaponSlotResolver_upv_1.GetToolClass(v43)) or "" local v45 = (v43 and (WeaponSlotResolver_upv_1.GetOrAssignToolSerial(v43))) or "" local v46 = (v43 and (v43.Name)) or "" local v47 = ((not v43) and 0) or (tonumber(v43:GetAttribute("Ammo")) or 0) local v48 = ((not v43) and 0) or (tonumber(v43:GetAttribute("StoredAmmo")) or (tonumber(v43:GetAttribute("Amount")) or 0)) local tbl_10 = {CurrentAmmo = 0, CrosshairVisible = 0, ScopeVisible = false, StoredAmmo = 0, Aiming = 0, TargetFOV = 0} tbl_10.Slot = v44 tbl_10.ToolSerial = v45 tbl_10.ToolName = v46 tbl_10.CurrentState = a1.CurrentState local v49 if CurrentTool_1 then v49 = true if CurrentTool_1.Aiming ~= true then v49 = false end else v49 = false end tbl_10.Aiming = v49 if a1.Crosshair then v49 = true if a1.Crosshair.Enabled ~= true then v49 = false end else v49 = false end tbl_10.CrosshairVisible = v49 tbl_10.TargetFOV = ((a1.Camera) and (a1.Camera.FieldOfView)) or (workspace.CurrentCamera.FieldOfView) tbl_10.CurrentAmmo = v47 tbl_10.StoredAmmo = v48 for key_2, value_9 in pairs(a2 or {}) do tbl_10[key_2] = value_9 end return tbl_10 end function tbl_4.SendPresentationEvent(a1, a2, a3) --[[ name: SendPresentationEvent line: 798 ]] if a1.StateReplicator then a1:GetStateFolder() return a1.StateReplicator:SendPresentationEvent(a2, a1:BuildPresentationEventContext(a3)) end return nil end function tbl_4.HasRegisteredTool(a1, a2) --[[ name: HasRegisteredTool line: 807 ]] local v50 if typeof(a2) ~= "number" then v50 = a2 else v50 = a1:GetClassFromIndex(a2) end if not v50 then return false end local v51 = a1.Tools and (a1.Tools[v50]) local v52 = false if v51 ~= nil then v52 = (v51.Tool ~= nil) and (v51.Model ~= nil) end return v52 end function tbl_4.GetFirstAvailableToolIndex(a1) --[[ name: GetFirstAvailableToolIndex line: 821 ]] for _, value_10 in ipairs({1, 2, 3, 4}) do if not (a1:HasRegisteredTool(value_10)) then continue end return value_10 end return nil end function tbl_4.GetRegisteredToolModels(a1) --[[ name: GetRegisteredToolModels line: 831 ]] local tbl_11 = {} for _, value_11 in pairs(a1.Tools or {}) do if not (value_11) then continue end if value_11.Model then table.insert(tbl_11, value_11.Model) end end return tbl_11 end function tbl_4.RefreshWeaponExtras(a1) --[[ name: RefreshWeaponExtras line: 843 upvalues: Weapon_upv_1 (copy, index: 1) ]] local v53 = nil if a1.CurrentTool and a1.CurrentTool.Model and a1.Holster ~= false then v53 = a1.CurrentTool.Model end Weapon_upv_1.SetExclusiveExtraState(a1:GetRegisteredToolModels(), v53, false) end function tbl_4.IsToolModelAttachedToArm(a1, a2) --[[ name: IsToolModelAttachedToArm line: 852 ]] local v54 = a2 and (a2:FindFirstChild("Handle") or (a2:FindFirstChild("Base"))) if a1.CameraModel and v54 and a2.Parent == a1.CameraModel then local Motor_1 = v54:FindFirstChild("Motor") local v55 = (Motor_1 ~= nil) and (Motor_1:IsA("Motor6D") and ((Motor_1.Part0 == a1.CameraModel.Tool) and (Motor_1.Part1 == v54))) return v55 end return false end function tbl_4.EnsureToolModelPresentation(a1, a2) --[[ name: EnsureToolModelPresentation line: 862 ]] if not a2 or not a2.Model then return end if a1.CurrentTool == a2 ~= true or a1.Holster == false then if a2.Model.Parent ~= script.ReserveModels or a1:IsToolModelAttachedToArm(a2.Model) == true then a1:DetachToolModelFromArm(a2.Model) end elseif a1:IsToolModelAttachedToArm(a2.Model) ~= true then a1:AttachToolModelToArm(a2.Model) end a1:RefreshWeaponExtras() end function tbl_4.EnsureCurrentToolPresentation(a1) --[[ name: EnsureCurrentToolPresentation line: 881 ]] if not a1.CurrentTool then return end a1:EnsureToolModelPresentation(a1.CurrentTool) end function tbl_4.SetTools(a1, a2, a3) --[[ name: SetTools line: 889 upvalues: WeaponSlotResolver_upv_1 (copy, index: 1) ReplicatedStorage_upv_1 (copy, index: 2) ComponentsManager_upv_1 (copy, index: 3) Weapon_upv_1 (copy, index: 4) ]] local v56 = a3:GetAttribute("Class") if not a3:IsA("Tool") then return end if v56 then if a1.Tools == nil then a1.Tools = {} end local v57 = a1.Tools[v56] local v58 = false local v59 = nil if v57 ~= nil then local Tool_1 = v57.Tool local v60 = Tool_1 and (Tool_1.Name == a3.Name) local v61 = Tool_1 and (Tool_1:GetAttribute("Skin") == a3:GetAttribute("Skin")) local v62 = Tool_1 and (Tool_1:GetAttribute("Class") == v56) local v63 = (v57.Model ~= nil) and (v57.Model.Parent ~= nil) local v64 = (Tool_1 and (WeaponSlotResolver_upv_1.GetOrAssignToolSerial(Tool_1))) or "" local v65 = WeaponSlotResolver_upv_1.GetOrAssignToolSerial(a3) local v66 = true if Tool_1 ~= a3 then v66 = (v64 ~= "") and (v64 == v65) end local v67 = (v60 == true) and ((v61 == true) and ((v62 == true) and (v63 == true))) if v67 == true and a1.CurrentTool == v57 and v66 == true then v67 = {ReloadCancel = 0, SemiCooldown = 0, Aiming = 0, Bolting = 0, Reloading = 0, Pumping = 0} v67.Aiming = v57.Aiming == true v67.ReloadCancel = v57.ReloadCancel == true v67.Reloading = v57.Reloading == true v67.Bolting = v57.Bolting == true v67.Pumping = v57.Pumping == true v67.SemiCooldown = v57.SemiCooldown == true v59 = v67 end if v67 == true then v58 = v67 else if a1.CurrentTool == v57 then a1.CurrentTool = nil a1.CurrentToolIndex = 0 end if v57.Model then v57.Model:Destroy() end a1.Tools[v56] = nil v57, v58 = nil, v67 end end if v57 == nil then a1.Tools[v56] = {} v57 = a1.Tools[v56] if v56 == "Primary" or v56 == "Secondary" then v57.Model = ReplicatedStorage_upv_1.Items.Weapon[a3.Name]:Clone() ComponentsManager_upv_1.Weapon.WeldWeapon(v57.Model) v57.Model.Parent = script.ReserveModels ComponentsManager_upv_1.Weapon.SetFullAttachmentOnWeapon(v57.Model, a2) local PlayerData_2 = a2:FindFirstChild("PlayerData") Weapon_upv_1.SetAttachmentSkins(v57.Model, PlayerData_2.Loadout[PlayerData_2.Settings:GetAttribute("LoadoutName")], v56) ComponentsManager_upv_1.Weapon.SetSkinOnWep(v57.Model, a3:GetAttribute("Skin")) ComponentsManager_upv_1.Weapon.SetupWeaponEffects(v57.Model) ComponentsManager_upv_1.Weapon.SetModelProperties(v57.Model, false, false) ComponentsManager_upv_1.Weapon.SetPlayerArmSkin(a1.CameraModel, a2) else v57.Model = ReplicatedStorage_upv_1.Items[v56][a3.Name]:Clone() ComponentsManager_upv_1.Weapon.WeldWeapon(v57.Model) v57.Model.Parent = script.ReserveModels ComponentsManager_upv_1.Weapon.SetModelProperties(v57.Model, false, false) end end v57.Tool = a3 v57.Stats = v57.Stats or {} if v56 == "Primary" or v56 == "Secondary" then v57.Settings = table.clone(require(a3:WaitForChild("Settings", 1))) v57.Settings.HRecoil = v57.Settings.HRecoil * (100 - (v57.Model:GetAttribute("Horizontal") * 0.01)) v57.Settings.VRecoil = v57.Settings.VRecoil * (100 - (v57.Model:GetAttribute("Vertical") * 0.01)) v57.Settings.HipFireReduction = v57.Model:GetAttribute("HipFireReduction") local v68, v69 = a1:GetADSZoom(v57.Model) v57.Settings.ADSZoom = v68 v57.Settings.SightFront = v69 v57.CrosshairSpread = v57.Settings.MaxSpread * (1 - (v57.Settings.HipFireReduction / 100)) if v57.Animations == nil or v58 ~= true then v57.Animations = a1:SetupToolAnimations(a2, a3:WaitForChild("Settings"):WaitForChild("Animations")) end elseif v57.Animations == nil or v58 ~= true then local v70 = v57.Model:FindFirstChild("Handle") or (v57.Model:FindFirstChild("Base")) v57.Animations = a1:SetupToolAnimations(a2, v70.Animations) end if v59 then v57.Aiming = v59.Aiming v57.ReloadCancel = v59.ReloadCancel v57.Reloading = v59.Reloading v57.Bolting = v59.Bolting v57.Pumping = v59.Pumping v57.SemiCooldown = v59.SemiCooldown else v57.Aiming = false v57.ReloadCancel = false v57.Reloading = false v57.Bolting = false v57.Pumping = false v57.SemiCooldown = false end Weapon_upv_1.SetExtraState(v57.Model, false, false) a1:EnsureToolModelPresentation(v57) end end function tbl_4.RemoveToolClass(a1, a2) --[[ name: RemoveToolClass line: 1005 upvalues: WeaponSlotResolver_upv_1 (copy, index: 1) ]] local Tools_1 = a1.Tools and (a1.Tools[a2]) if not Tools_1 then return end local v71 = a1.CurrentTool == Tools_1 if Tools_1.Model then Tools_1.Model:Destroy() end a1.Tools[a2] = nil if v71 then a1.CurrentTool = nil if a1.CurrentToolIndex == WeaponSlotResolver_upv_1.GetIndexFromClass(a2) then a1.CurrentToolIndex = 0 end end a1:RefreshWeaponExtras() end function tbl_4.SyncToolsFromInventory(a1, a2, a3) --[[ name: SyncToolsFromInventory line: 1027 upvalues: WeaponSlotResolver_upv_1 (copy, index: 1) ]] a1.Tools = a1.Tools or {} local CurrentToolIndex_upv_1 = a1.CurrentToolIndex local v72 = ((CurrentToolIndex_upv_1 ~= 0) and (a1:GetClassFromIndex(CurrentToolIndex_upv_1))) or nil local v73 = false for _, value_12 in ipairs(WeaponSlotResolver_upv_1.GetSupportedSlots()) do local v74 = a3[value_12] if not (v74) then a1:RemoveToolClass(value_12) continue end local v75 = a1.Tools[value_12] and (a1.Tools[value_12].Tool) a1:SetTools(a2, v74) if v72 ~= value_12 then continue end if v75 ~= v74 then v73 = true end end if not v72 or v73 ~= true or not a1:HasRegisteredTool(CurrentToolIndex_upv_1) then return end task.defer( function() --[[ line: 1048 upvalues: a1 (copy, index: 1) CurrentToolIndex_upv_1 (copy, index: 2) ]] if not a1:HasRegisteredTool(CurrentToolIndex_upv_1) then return end a1:SwapTools(CurrentToolIndex_upv_1, true) end ) end function tbl_4.SetupTools(a1, a2) --[[ name: SetupTools line: 1056 upvalues: WeaponInventoryController_upv_1 (copy, index: 1) ]] a1.Tools = {} a1:GetStateFolder() if a1.InventoryDisconnect then a1.InventoryDisconnect() a1.InventoryDisconnect = nil end a1.InventoryDisconnect = WeaponInventoryController_upv_1.WatchPlayerInventory( a2, function(a3) --[[ line: 1065 upvalues: a1 (copy, index: 1) a2 (copy, index: 2) ]] a1:SyncToolsFromInventory(a2, a3) end ) end function tbl_4.Died(a1, a2) --[[ name: Died line: 1070 ]] local Character_6 = a1.Player.Character assert(Character_6, "Died failed because there is no player character") Character_6:WaitForChild("Humanoid").Died:Connect( function() --[[ line: 1074 upvalues: a1 (copy, index: 1) ]] if a1.InventoryDisconnect then a1.InventoryDisconnect() a1.InventoryDisconnect = nil end a1.CameraModel:Destroy() a1.CurrentTool = nil a1.Crosshair:Disable() end ) end function tbl_4.SetupCrosshair(a1) --[[ name: SetupCrosshair line: 1086 upvalues: Config_upv_1 (copy, index: 1) DynamicCrosshair_upv_1 (copy, index: 2) ]] if not Config_upv_1.Crosshair then return end local Crosshair_1 = a1.Player.PlayerGui.Crosshair Crosshair_1:ClearAllChildren() a1.Crosshair = DynamicCrosshair_upv_1.New(Crosshair_1, 0, 150, 200, 0, false) a1.Crosshair.EasingStyle = Enum.EasingStyle.Sine a1.Crosshair.EasingDirection = Enum.EasingDirection.InOut a1.Crosshair:Size(6, 2) a1.Crosshair:Display({BackgroundTransparency = 0.6, ImageTransparency = 0, BorderSizePixel = 0, BackgroundColor3 = Color3.fromRGB(255, 255, 255)}) end function tbl_4.GetToolAnimationFolder(a1, a2, a3) --[[ name: GetToolAnimationFolder line: 1121 ]] if not a2 then return nil end local function IsValidAnimationFolder(a4) --[[ name: IsValidAnimationFolder line: 1126 ]] if a4 and a4:IsA("Folder") and a4.Name == "Animations" and a4:FindFirstChild("Client") and a4:FindFirstChild("Server") then return true end return false end local function FindAnimationsInside(a5) --[[ name: FindAnimationsInside line: 1150 ]] if not a5 then return nil end local Animations_1 = a5:FindFirstChild("Animations") local v76 if Animations_1 then Animations_1:IsA("Folder") end v76 = false if v76 then return Animations_1 end local Settings_1 = a5:FindFirstChild("Settings") local v77 = nil if Settings_1 then v77 = Settings_1:FindFirstChild("Animations") local v78 if v77 then v77:IsA("Folder") end v78 = false if v78 then return v77 end end local v79 = nil for _, value_13 in ipairs(a5:GetDescendants()) do if value_13 and value_13:IsA("Folder") and value_13.Name == "Animations" and value_13:FindFirstChild("Client") then v79 = value_13:FindFirstChild("Server") else v79 = false end if not (v79) then continue end return value_13 end return nil end local v80 = FindAnimationsInside(a2.Tool) if v80 then return v80 end local v81 = FindAnimationsInside(a2.Model) if v81 then return v81 end return nil end function tbl_4.SwapTools(a1, a2, a3) --[[ name: SwapTools line: 1195 upvalues: Utility_upv_1 (copy, index: 1) WeaponSlotResolver_upv_1 (copy, index: 2) ]] if a1.CameraModel then if a1.CameraModel:FindFirstChild("Tool") then a1:SetFP(a1.Player) local v82 if a2 == 1 then v82 = "Primary" elseif a2 == 2 then v82 = "Secondary" elseif a2 ~= 3 then if a2 ~= 4 then warn(Utility_upv_1.warnCustom(("Failed to swap tools because weapon index %* is invalid"):format(a2))) return false end v82 = "Throwable" else v82 = "Knife" end local Tools_2 = a1.Tools and (a1.Tools[v82]) if Tools_2 then if Tools_2.Tool then if Tools_2.Model then local v83 = a1:GetToolAnimationFolder(Tools_2, v82) if v83 then if not (a1:ValidateToolAnimations(Tools_2, {"Equip", "Hold"}, {"Equip", "Hold"})) then Tools_2.Animations = a1:SetupToolAnimations(a1.Player, v83) warn(Utility_upv_1.warnCustom(("Weapon animation repatch activated for %*"):format(Tools_2.Tool.Name))) end if a1:ValidateToolAnimations(Tools_2, {"Equip", "Hold"}, {"Equip", "Hold"}) then for key_3, value_14 in pairs(a1.Tools or {}) do if not (value_14) then continue end if value_14.Model then a1:DetachToolModelFromArm(value_14.Model) end end local u2 = a1.SpawnEquipPresentationPending == true local v84 = true local key_3 = false local v85 = false local tbl_12 if u2 ~= true then tbl_12 = nil else tbl_12 = false end a1:SetReadinessState(v84, key_3, v85, tbl_12) a1:AttachToolModelToArm(Tools_2.Model) a1.CurrentTool = Tools_2 a1.CurrentToolID = math.random(-100, 100) a1.CurrentToolIndex = a2 a1:ResetWeaponPresentationState(Tools_2) a1:EnsureCurrentToolPresentation() v84 = true key_3 = true local v86 = false if u2 ~= true then tbl_12 = nil else tbl_12 = false end a1:SetReadinessState(v84, key_3, v86, tbl_12) local v87 = WeaponSlotResolver_upv_1.GetOrAssignToolSerial(Tools_2.Tool) if a3 ~= true then a1:SendEquipRequest(v82, Tools_2.Tool) else a1:ConfirmServerEquip({Slot = v82, ToolSerial = v87, ToolName = Tools_2.Tool.Name}) end a1:MagazineActivation() a1:StopOtherToolsAnimations() a1.SpawnEquipPresentationPending = false a1.CurrentTool.Animations.Client.Equip:Play() a1.CurrentTool.Animations.Server.Equip:Play() a1:SendPresentationEvent("ToolSwapPresented", {Reloading = false, Aiming = false, CurrentState = "Hold", Slot = v82, ToolSerial = v87, ToolName = Tools_2.Tool.Name, Holstered = a1.Holster, IsInitialSpawnPresentation = u2}) local CurrentTool_upv_2 = a1.CurrentTool local CurrentToolID_upv_1 = a1.CurrentToolID task.spawn( function() --[[ line: 1317 upvalues: CurrentTool_upv_2 (copy, index: 1) a1 (copy, index: 2) CurrentToolID_upv_1 (copy, index: 3) WeaponSlotResolver_upv_1 (copy, index: 4) u2 (copy, index: 5) ]] if CurrentTool_upv_2 and CurrentTool_upv_2.Animations and CurrentTool_upv_2.Animations.Client and CurrentTool_upv_2.Animations.Client.Equip then CurrentTool_upv_2.Animations.Client.Equip.Stopped:Wait() end if a1.CurrentTool ~= CurrentTool_upv_2 then return end if a1.CurrentToolID == CurrentToolID_upv_1 then local v88 = true if CurrentTool_upv_2.Aiming ~= true then v88 = a1.CurrentState == "ADS" end local v89 = nil if v88 ~= true then v89 = a1:GetClientWeaponSystemScript() if v89 then local v90 = v89:GetAttribute("BufferedADSIntent") == true local v91 = tonumber(v89:GetAttribute("BufferedADSSwapGeneration")) or 0 local v92 = tonumber(v89:GetAttribute("SwapGeneration")) or 0 local str_1 = tostring(v89:GetAttribute("BufferedADSToolSerial") or "") local v93 = ((CurrentTool_upv_2.Tool) and (WeaponSlotResolver_upv_1.GetOrAssignToolSerial(CurrentTool_upv_2.Tool))) or "" v88 = v90 == true and v91 ~= 0 and v91 == v92 and str_1 ~= "" and str_1 == v93 end end if v88 ~= true then a1:ResumeHoldPresentation(CurrentTool_upv_2) else CurrentTool_upv_2.Aiming = true a1:PrepareEquipTransitionForADS(CurrentTool_upv_2) a1.CurrentState = "ADS" a1:PushRuntimeState("ADS", {Inspecting = false, Reloading = false, Aiming = true, Holstered = a1.Holster}) if a1.Crosshair then a1.Crosshair:Disable() end if CurrentTool_upv_2.Settings and CurrentTool_upv_2.Settings.SightFront then CurrentTool_upv_2.Settings.SightFront.Transparency = 0 end end a1:SetReadinessState(false, true, true, ((u2 == true) and true) or nil) end end ) a1.CurrentState = ((a1.CurrentTool.Aiming ~= true) and "Hold") or "ADS" local CurrentState_1 = a1.CurrentState tbl_12 = {Holstered = 0, Inspecting = false, Reloading = false, Aiming = 0} tbl_12.Aiming = a1.CurrentTool.Aiming == true tbl_12.Holstered = a1.Holster a1:PushRuntimeState(CurrentState_1, tbl_12) if a1.CurrentTool.Bolting == true then a1:Bolt() elseif a1.CurrentTool.Pumping == true then a1:Pump() end if a1.Crosshair then local v95 = nil if Tools_2.CrosshairSpread then a1.Crosshair:Enable() a1.Crosshair:FollowMouse(false) a1.Crosshair:Size(6, 2) v95 = Tools_2.CrosshairSpread * 10 if v95 < a1.Crosshair.Spreading.MinSpread then a1.Crosshair.Spreading.MinSpread = v95 a1.Crosshair:SmoothSet(v95, 0.06) else a1.Crosshair:SmoothSet(v95, 0.06) a1.Crosshair.Spreading.MinSpread = v95 end elseif v82 ~= "Throwable" then a1.Crosshair:Size(3, 3) a1.Crosshair.Spreading.MinSpread = 0 a1.Crosshair:SmoothSet(0, 0.06) else a1.Crosshair:Enable() a1.Crosshair:FollowMouse(false) a1.Crosshair:Size(2, 16) a1.Crosshair.Spreading.MinSpread = 50 a1.Crosshair:Set(50) end end a1:SoundCue("Equip", true) return true end warn(Utility_upv_1.warnCustom(("Failed to swap to %* because required Equip/Hold animations are missing for %* on index %*"):format(Tools_2.Tool.Name, a1.Player.Name, a2))) else warn(Utility_upv_1.warnCustom(("Failed to swap tools because %* has no valid Animations folder with Client and Server folders. Checked Tool and Model."):format(Tools_2.Tool.Name))) if Tools_2.Tool then warn(Utility_upv_1.warnCustom(("Tool path: %*"):format(Tools_2.Tool:GetFullName()))) end if Tools_2.Model then warn(Utility_upv_1.warnCustom(("Model path: %*"):format(Tools_2.Model:GetFullName()))) end end else warn(Utility_upv_1.warnCustom(("Failed to swap tools because ToolData.Model for %* is nil on index %* for %*"):format(Tools_2.Tool.Name, a2, a1.Player.Name))) end else warn(Utility_upv_1.warnCustom(("Failed to swap tools because ToolData.Tool for %* is nil on index %* for %*"):format(v82, a2, a1.Player.Name))) end elseif v82 ~= "Throwable" then warn(Utility_upv_1.warnCustom(("Failed to swap tools because ToolData for %* is nil on index %* for %*"):format(v82, a2, a1.Player.Name))) end else warn(Utility_upv_1.warnCustom("Failed to swap tools because CameraModel.Tool is missing")) end else warn(Utility_upv_1.warnCustom("Failed to swap tools because CameraModel is nil")) end return false end function tbl_4.SetToolSurfaceGuiEnabled(a1, a2, a3, a4) --[[ name: SetToolSurfaceGuiEnabled line: 1412 ]] if a2 then local v96 if a4 ~= nil then v96 = a4 else v96 = true end for _, value_15 in ipairs(a2:GetDescendants()) do if not (value_15:IsA("SurfaceGui")) then continue end local v97 = value_15.Parent and (value_15.Parent.Name == "Reticle") if v96 == true or v97 ~= true then value_15.Enabled = a3 end end end end function tbl_4.AttachToolModelToArm(a1, a2) --[[ name: AttachToolModelToArm line: 1432 upvalues: Weapon_upv_1 (copy, index: 1) ]] local v98 = a2:FindFirstChild("Handle") or (a2:FindFirstChild("Base")) if not a1.CameraModel then return end if v98 then a2.Parent = a1.CameraModel local Motor_2 = v98:FindFirstChild("Motor") if Motor_2 == nil then local v99 = Instance.new("Motor6D", v98) v99.Name = "Motor" end v99.Part1 = v98 v99.Part0 = a1.CameraModel.Tool v98.Anchored = false v99.C1 = CFrame.new(0, 0, 0) local v99 = Weapon_upv_1.GetWeaponExtra(a2) if v99 then Weapon_upv_1.InitializeExtraAttachment(v99) end a1:SetToolSurfaceGuiEnabled(a2, true, false) a1.AimPart = a2:FindFirstChild("Aim") end end function tbl_4.DetachToolModelFromArm(a1, a2) --[[ name: DetachToolModelFromArm line: 1460 upvalues: Utility_upv_1 (copy, index: 1) Weapon_upv_1 (copy, index: 2) ]] local v100 = a2:FindFirstChild("Handle") or (a2:FindFirstChild("Base")) if not a1.CameraModel then return end if v100 then local v101 = v100:FindFirstChild("Motor") if v101 == nil then v101 = Instance.new("Motor6D", v100) v101.Name = "Motor" end v101.Part1 = v100 if (a1.CameraModel) and (a1.CameraModel:FindFirstChild("Base")) then v101.Part0 = a1.CameraModel.Base else warn(Utility_upv_1.formatWarnInstanceIsNil("self.CameraModel", "Base")) end v100.Anchored = false v101.C1 = CFrame.new(0, 0, -10) a1:SetToolSurfaceGuiEnabled(a2, false) Weapon_upv_1.SetExtraState(a2, false, false) a2.Parent = script.ReserveModels end end function tbl_4.MagazineActivation(a1) --[[ name: MagazineActivation line: 1488 ]] for _, value_16 in pairs(a1.Tools) do local v102 = value_16.Model:FindFirstChild("Magazine", true) if v102 then v102.Name = "MagazineDisabled" end end local MagazineDisabled_1 = a1.CurrentTool.Model:FindFirstChild("MagazineDisabled") if not MagazineDisabled_1 then return end MagazineDisabled_1.Name = "Magazine" end function tbl_4.StopOtherToolsAnimations(a1) --[[ name: StopOtherToolsAnimations line: 1502 ]] for _, value_17 in pairs(a1.Tools or {}) do for v1, value_18 in pairs(value_17.Animations or {}) do for v2, value_19 in pairs(value_18) do if not (value_19) or typeof(value_19) ~= "Instance" then continue end if value_19:IsA("AnimationTrack") then value_19:Stop() end end end end end function tbl_4.ToggleToolModelVisible(a1, a2, a3) --[[ name: ToggleToolModelVisible line: 1514 ]] a1:SetToolSurfaceGuiEnabled(a2, a3) if a3 ~= true then for _, value_20 in pairs(a2:GetChildren()) do if not (value_20:IsA("BasePart")) or value_20.Name == "Base" then continue end if value_20.Name ~= "Handle" then value_20.Transparency = 1 end end else for _, value_21 in pairs(a2:GetChildren()) do if not (value_21:IsA("BasePart")) or value_21.Name == "Base" then continue end if value_21.Name ~= "Handle" then value_21.Transparency = 0 end end end end function tbl_4.Vault(a1) --[[ name: Vault line: 1531 ]] a1:SoundCue("Vault", true) local CurrentTool_upv_3 = a1.CurrentTool assert(CurrentTool_upv_3, "Failed to Vault because no CurrentTool exists") local u3 = a1:GetClientWeaponSystemScript() local u4 = a1:GetStateFolder() local function pushVaultRuntimeState(a2, a3) --[[ name: pushVaultRuntimeState line: 1538 upvalues: a1 (copy, index: 1) CurrentTool_upv_3 (copy, index: 2) ]] local tbl_13 = {VaultActive = 0, Aiming = 0, Holstered = 0, Reloading = false, Inspecting = false} tbl_13.Aiming = CurrentTool_upv_3.Aiming == true tbl_13.Holstered = a1.Holster tbl_13.VaultActive = a3 a1:PushRuntimeState(a2, tbl_13) end local function clearVaultRuntimeState() --[[ name: clearVaultRuntimeState line: 1548 upvalues: a1 (copy, index: 1) ]] a1:PushRuntimeState(a1.CurrentState, {VaultActive = false}) end if u3 then u3:SetAttribute("ServerVaultOverride", true) end local v103 = ((CurrentTool_upv_3.Aiming ~= true) and "Hold") or "ADS" local tbl_14 = {VaultActive = true, Aiming = 0, Holstered = 0, Reloading = false, Inspecting = false} tbl_14.Aiming = CurrentTool_upv_3.Aiming == true tbl_14.Holstered = a1.Holster a1:PushRuntimeState(v103, tbl_14) if a1.Animations.Server.Run then a1.Animations.Server.Run:Stop(0.05) end if CurrentTool_upv_3.Aiming == false then a1.CurrentState = "Hold" a1:SendPresentationEvent("VaultStart", {Aiming = false, Reloading = false, CurrentState = "Hold", Inspecting = false, Holstered = a1.Holster}) a1.Animations.Client.Vault:Play() a1.Animations.Client.Vault:AdjustSpeed(1) end local Vault_upv_1 = a1.Animations.Server.Vault Vault_upv_1:Play() task.spawn( function() --[[ line: 1578 upvalues: Vault_upv_1 (copy, index: 1) u3 (copy, index: 2) a1 (copy, index: 3) CurrentTool_upv_3 (copy, index: 4) u4 (copy, index: 5) ]] Vault_upv_1.Stopped:Wait() if u3 then u3:SetAttribute("ServerVaultOverride", false) end a1:PushRuntimeState(a1.CurrentState, {VaultActive = false}) if a1.CurrentTool ~= CurrentTool_upv_3 or a1.Animations.Server.Vault ~= Vault_upv_1 then return end task.defer( function() --[[ line: 1588 upvalues: a1 (copy, index: 1) CurrentTool_upv_3 (copy, index: 2) Vault_upv_1 (copy, index: 3) u4 (copy, index: 4) ]] if a1.CurrentTool ~= CurrentTool_upv_3 then return end if a1.Animations.Server.Vault == Vault_upv_1 then local v104 = (u4 and (u4:GetAttribute("Movement"))) or nil if v104 ~= "Running" then a1:PlayServerHold() else a1:StopServerHold() if a1.Animations.Server.Run and a1.Animations.Server.Run.IsPlaying ~= true then a1.Animations.Server.Run:Play(0.05) return end end end end ) end ) end function tbl_4.PrepareEquipTransitionForHold(a1, a2, a3) --[[ name: PrepareEquipTransitionForHold line: 1606 ]] if not a2 then return end if a2.Animations then local v105 = a3 or 0.08 local Client_1 = a2.Animations.Client local v106 = a2.Animations.Server Client_1 = v106 local _ = Client_1 and (v106.Hold) if Client_1 then local v107 = true if Client_1.IsPlaying == true then v106 = v107 else v106 = v106 and (v106.IsPlaying == true) end else v106 = v106 and (v106.IsPlaying == true) end if v106 ~= true then return end if Client_1 and Client_1.IsPlaying ~= true then Client_1:Play(v105) end if Client_1 and Client_1.IsPlaying ~= true then Client_1:Play(v105) end if Client_1 and Client_1.IsPlaying == true then Client_1:Stop(v105) end if v106 and v106.IsPlaying == true then v106:Stop(v105) end end end function tbl_4.PrepareEquipTransitionForADS(a1, a2) --[[ name: PrepareEquipTransitionForADS line: 1637 ]] if not a2 or a1.CurrentTool ~= a2 then return end if a2.Animations then local Client_2 = a2.Animations.Client local Server_1 = a2.Animations.Server local Animations_2 = a1.Animations local v108 = Animations_2 and (a1.Animations.Client) local Animations_3 = a1.Animations local v109 = Animations_3 and (a1.Animations.Server) local function StopTrack(a3) --[[ name: StopTrack line: 1649 ]] if not a3 or a3.IsPlaying ~= true then return end a3:Stop(0) end local v110 = Client_2 and (Client_2.Equip) if v110 and v110.IsPlaying == true then v110:Stop(0) end local v111 = Server_1 and (Server_1.Equip) if v111 and v111.IsPlaying == true then v111:Stop(0) end local v112 = Client_2 and (Client_2.Inspect) if v112 and v112.IsPlaying == true then v112:Stop(0) end local v113 = Server_1 and (Server_1.Inspect) if v113 and v113.IsPlaying == true then v113:Stop(0) end local v114 = Client_2 and (Client_2.Action) if v114 and v114.IsPlaying == true then v114:Stop(0) end local v115 = Server_1 and (Server_1.Action) if v115 and v115.IsPlaying == true then v115:Stop(0) end local v116 = Client_2 and (Client_2.Reload) if v116 and v116.IsPlaying == true then v116:Stop(0) end local v117 = Server_1 and (Server_1.Reload) if v117 and v117.IsPlaying == true then v117:Stop(0) end local v118 = Client_2 and (Client_2.Vault) if v118 and v118.IsPlaying == true then v118:Stop(0) end local v119 = Server_1 and (Server_1.Vault) if v119 and v119.IsPlaying == true then v119:Stop(0) end local v120 = v108 and (v108.Vault) if v120 and v120.IsPlaying == true then v120:Stop(0) end local v121 = v109 and (v109.Vault) if v121 and v121.IsPlaying == true then v121:Stop(0) end if Client_2 then if Client_2 and Client_2.IsPlaying == true then Client_2:Stop(0) end Client_2:Play(0) end if Server_1 then if Server_1 and Server_1.IsPlaying == true then Server_1:Stop(0) end Server_1:Play(0) end end end function tbl_4.ResumeHoldPresentation(a1, a2) --[[ name: ResumeHoldPresentation line: 1678 ]] if a2 and a1.CurrentTool == a2 and a1.CurrentState == "Hold" then local Character_7 = a1.Player.Character if a2.Aiming ~= true and a2.Reloading ~= true and a2.Bolting ~= true and a2.Pumping ~= true then if a1.Holster ~= true or Character_7 and Character_7:GetAttribute("Barricading") == true then return false end a1:PrepareEquipTransitionForHold(a2, 0.08) local Animations_4 = a2.Animations local Animations_5 = a2.Animations local v122 = Animations_5 and (a2.Animations.Server) local v123 = v122 local _ = v123 and (v122.Vault) if Animations_4 and Animations_4.IsPlaying == true then Animations_4:Stop(0.05) end local function StopTrack_2(a3, a4) --[[ name: StopTrack line: 1708 ]] if not a3 or a3.IsPlaying ~= true then return end a3:Stop(a4 or 0.08) end if v122 and v122.IsPlaying == true then v122:Stop(0.05) end if Animations_4 and Animations_4.IsPlaying == true then Animations_4:Stop(0.05) end if v122 and v122.IsPlaying == true then v122:Stop(0.05) end if Animations_4 and Animations_4.IsPlaying == true then Animations_4:Stop(0.05) end if v122 and v122.IsPlaying == true then v122:Stop(0.05) end if Animations_4 and Animations_4.IsPlaying == true then Animations_4:Stop(0.05) end if v123 and v123.IsPlaying == true then v123:Stop(0.05) end if Animations_4 then if Animations_4 and Animations_4.IsPlaying == true then Animations_4:Stop(0.05) end Animations_4:Play(0.12) end if v122 then if v122 and v122.IsPlaying == true then v122:Stop(0.05) end v122:Play(0.12) end local v124 = true if Animations_4 == nil then v124 = v122 ~= nil end return v124 end return false end return false end function tbl_4.ADS(a1) --[[ name: ADS line: 1735 ]] local CurrentTool_4 = a1.CurrentTool assert(CurrentTool_4, "Failed to ADS because no CurrentTool exists") a1:PrepareEquipTransitionForADS(CurrentTool_4) a1.CurrentState = "ADS" CurrentTool_4.Aiming = true a1:PushRuntimeState("ADS", {Inspecting = false, Reloading = false, Aiming = true, Holstered = a1.Holster}) a1:SoundCue("ADS", true) if a1.Crosshair then a1.Crosshair:Disable() end if not CurrentTool_4.Settings.SightFront then return end CurrentTool_4.Settings.SightFront.Transparency = 0 end function tbl_4.ReleaseADS(a1) --[[ name: ReleaseADS line: 1757 ]] local CurrentTool_5 = a1.CurrentTool assert(CurrentTool_5, "Failed to ReleaseADS because no CurrentTool exists") a1.CurrentState = "Hold" CurrentTool_5.Aiming = false a1:ResumeHoldPresentation(CurrentTool_5) local tbl_15 = {Holstered = 0, Inspecting = false, Reloading = 0, Aiming = false} tbl_15.Reloading = CurrentTool_5.Reloading == true tbl_15.Holstered = a1.Holster a1:PushRuntimeState("Hold", tbl_15) a1:SoundCue("ADSRelease", true) if a1.Crosshair then a1.Crosshair:Enable() end if not CurrentTool_5.Settings.SightFront then return end CurrentTool_5.Settings.SightFront.Transparency = 0 end function tbl_4.Inspect(a1) --[[ name: Inspect line: 1779 ]] local CurrentTool_upv_6 = a1.CurrentTool if not CurrentTool_upv_6 then return end a1.CurrentState = "Inspect" a1:PushRuntimeState("Inspect", {Inspecting = true, Reloading = false, Aiming = false, Holstered = a1.Holster}) a1:SendPresentationEvent("InspectStart", {Aiming = false, Reloading = false, CurrentState = "Inspect", Inspecting = true, Holstered = a1.Holster}) CurrentTool_upv_6.Animations.Client.Inspect:Play() if CurrentTool_upv_6.Animations.Client.Reload then CurrentTool_upv_6.ReloadCancel = true CurrentTool_upv_6.Animations.Client.Reload:Stop() CurrentTool_upv_6.Animations.Server.Reload:Stop() end task.spawn( function() --[[ line: 1808 upvalues: CurrentTool_upv_6 (copy, index: 1) a1 (copy, index: 2) ]] CurrentTool_upv_6.Animations.Client.Inspect.Stopped:Wait() if a1.CurrentTool ~= CurrentTool_upv_6 then return end if a1.CurrentState == "Inspect" then a1.CurrentState = "Hold" a1:ResumeHoldPresentation(CurrentTool_upv_6) local tbl_16 = {Holstered = 0, Inspecting = false, Reloading = 0, Aiming = 0} tbl_16.Aiming = CurrentTool_upv_6.Aiming == true tbl_16.Reloading = CurrentTool_upv_6.Reloading == true tbl_16.Holstered = a1.Holster a1:PushRuntimeState("Hold", tbl_16) end end ) end function tbl_4.CancelInspect(a1) --[[ name: CancelInspect line: 1823 ]] local CurrentTool_7 = a1.CurrentTool if not CurrentTool_7 then return false end local Animations_6 = CurrentTool_7.Animations local Animations_7 = CurrentTool_7.Animations local v125 = Animations_7 and (CurrentTool_7.Animations.Server) local _ = v125 and (v125.Inspect) v125 = true if a1.CurrentState ~= "Inspect" then if Animations_6 then v125 = true if Animations_6.IsPlaying ~= true then v125 = v125 and (v125.IsPlaying == true) end else v125 = v125 and (v125.IsPlaying == true) end end if v125 ~= true then return false end if v125 and v125.IsPlaying == true then v125:Stop(0.05) end if Animations_6 and Animations_6.IsPlaying == true then Animations_6:Stop(0.05) end a1.CurrentState = "Hold" a1:ResumeHoldPresentation(CurrentTool_7) local tbl_17 = {Holstered = 0, Inspecting = false, Reloading = 0, Aiming = 0} tbl_17.Aiming = CurrentTool_7.Aiming == true tbl_17.Reloading = CurrentTool_7.Reloading == true tbl_17.Holstered = a1.Holster a1:PushRuntimeState("Hold", tbl_17) return true end function tbl_4.Bolt(a1) --[[ name: Bolt line: 1859 ]] local CurrentTool_8 = a1.CurrentTool assert(CurrentTool_8, "Failed to Bolt because no CurrentTool exists") CurrentTool_8.Bolting = true a1.CurrentState = "Action" local tbl_18 = {Holstered = 0, Inspecting = false, Reloading = false, Aiming = 0} tbl_18.Aiming = CurrentTool_8.Aiming == true tbl_18.Holstered = a1.Holster a1:PushRuntimeState("Action", tbl_18) local tbl_19 = {Aiming = 0, Holstered = 0, Reloading = false, CurrentState = "Action", Inspecting = false} tbl_19.Aiming = CurrentTool_8.Aiming == true tbl_19.Holstered = a1.Holster a1:SendPresentationEvent("BoltStart", tbl_19) if CurrentTool_8.Animations.Client.Bolt and CurrentTool_8.Animations.Server.Bolt then CurrentTool_8.Animations.Client.Bolt:Play() CurrentTool_8.Animations.Server.Bolt:Play() end if CurrentTool_8.Animations.Client.Bolt then CurrentTool_8.Animations.Client.Bolt.Stopped:Wait() end if CurrentTool_8 == CurrentTool_8 then CurrentTool_8.Bolting = false a1.CurrentState = ((CurrentTool_8.Aiming ~= true) and "Hold") or "ADS" if a1.CurrentState == "Hold" then a1:ResumeHoldPresentation(CurrentTool_8) end local CurrentState_2 = a1.CurrentState local tbl_20 = {Holstered = 0, Inspecting = false, Reloading = 0, Aiming = 0} tbl_20.Aiming = CurrentTool_8.Aiming == true tbl_20.Reloading = CurrentTool_8.Reloading == true tbl_20.Holstered = a1.Holster a1:PushRuntimeState(CurrentState_2, tbl_20) end end function tbl_4.Pump(a1) --[[ name: Pump line: 1905 ]] local CurrentTool_9 = a1.CurrentTool assert(CurrentTool_9, "Failed to Pump-1 because no CurrentTool exists") CurrentTool_9.Pumping = true local CurrentTool_10 = a1.CurrentTool a1.CurrentState = "Action" local tbl_21 = {Holstered = 0, Inspecting = false, Reloading = false, Aiming = 0} tbl_21.Aiming = CurrentTool_9.Aiming == true tbl_21.Holstered = a1.Holster a1:PushRuntimeState("Action", tbl_21) local tbl_22 = {Aiming = 0, Holstered = 0, Reloading = false, CurrentState = "Action", Inspecting = false} tbl_22.Aiming = CurrentTool_9.Aiming == true tbl_22.Holstered = a1.Holster a1:SendPresentationEvent("PumpStart", tbl_22) if CurrentTool_9.Animations.Client.Pump and CurrentTool_9.Animations.Server.Pump then CurrentTool_9.Animations.Client.Pump:Play() CurrentTool_9.Animations.Server.Pump:Play() end if CurrentTool_9.Animations.Client.Pump then CurrentTool_9.Animations.Client.Pump.Stopped:Wait() end if CurrentTool_9 == CurrentTool_10 then CurrentTool_9.Pumping = false a1.CurrentState = ((CurrentTool_9.Aiming ~= true) and "Hold") or "ADS" if a1.CurrentState == "Hold" then a1:ResumeHoldPresentation(CurrentTool_9) end local CurrentState_3 = a1.CurrentState local tbl_23 = {Holstered = 0, Inspecting = false, Reloading = 0, Aiming = 0} tbl_23.Aiming = CurrentTool_9.Aiming == true tbl_23.Reloading = CurrentTool_9.Reloading == true tbl_23.Holstered = a1.Holster a1:PushRuntimeState(CurrentState_3, tbl_23) end end function tbl_4.HolsterWeapon(a1, a2) --[[ name: HolsterWeapon line: 1950 ]] local CurrentTool_11 = a1.CurrentTool assert(CurrentTool_11, "Failed to HolsterWeapon because no CurrentTool exists") if a2 == false then a1.Holster = false a1:DetachToolModelFromArm(CurrentTool_11.Model) elseif a2 == true then a1.Holster = true a1:AttachToolModelToArm(CurrentTool_11.Model) end a1:RefreshWeaponExtras() local CurrentState_4 = a1.CurrentState local tbl_24 = {Aiming = 0, Inspecting = 0, Reloading = 0} tbl_24.Holstered = a1.Holster tbl_24.Aiming = CurrentTool_11.Aiming == true tbl_24.Inspecting = a1.CurrentState == "Inspect" tbl_24.Reloading = CurrentTool_11.Reloading == true a1:PushRuntimeState(CurrentState_4, tbl_24) end function tbl_4.EnterBarricadePresentation(a1) --[[ name: EnterBarricadePresentation line: 1971 ]] local CurrentTool_12 = a1.CurrentTool assert(CurrentTool_12, "Failed to EnterBarricadePresentation because no CurrentTool exists") if CurrentTool_12.Aiming == true then a1:ReleaseADS() end if CurrentTool_12.Reloading == true then CurrentTool_12.ReloadCancel = true end a1:StopCurrentToolAnimation(false) if a1.Animations.Client.Run and a1.Animations.Client.Run.IsPlaying == true then a1.Animations.Client.Run:Stop() end if a1.Animations.Server.Run and a1.Animations.Server.Run.IsPlaying == true then a1.Animations.Server.Run:Stop() end a1.CurrentState = "Hold" local tbl_25 = {Holstered = 0, Inspecting = false, Reloading = 0, Aiming = false} tbl_25.Reloading = CurrentTool_12.Reloading == true tbl_25.Holstered = a1.Holster a1:PushRuntimeState("Hold", tbl_25) end function tbl_4.ExitBarricadePresentation(a1) --[[ name: ExitBarricadePresentation line: 2001 ]] local CurrentTool_13 = a1.CurrentTool if not CurrentTool_13 then return end if CurrentTool_13.Aiming ~= true and CurrentTool_13.Reloading ~= true and CurrentTool_13.Bolting ~= true and CurrentTool_13.Pumping ~= true and a1.ActionDebounce ~= true then a1.CurrentState = "Hold" a1:ResumeHoldPresentation(CurrentTool_13) a1:PushRuntimeState("Hold", {Inspecting = false, Reloading = false, Aiming = false, Holstered = a1.Holster}) return end local CurrentState_5 = a1.CurrentState local tbl_26 = {Holstered = 0, Inspecting = 0, Reloading = 0, Aiming = 0} tbl_26.Aiming = CurrentTool_13.Aiming == true tbl_26.Inspecting = a1.CurrentState == "Inspect" tbl_26.Reloading = CurrentTool_13.Reloading == true tbl_26.Holstered = a1.Holster a1:PushRuntimeState(CurrentState_5, tbl_26) end function tbl_4.Shoot(a1) --[[ name: Shoot line: 2027 upvalues: Config_upv_1 (copy, index: 1) ]] if a1.CurrentTool and a1.CurrentTool.Animations.Client.Shoot then a1.CurrentTool.Animations.Client.Shoot:Play() end if Config_upv_1.Crosshair ~= true or not a1.Crosshair or not a1.CurrentTool or not a1.CurrentTool.CrosshairSpread then return end a1.Crosshair:SmoothSet((a1.CurrentTool.CrosshairSpread * 10) + 20, 0.05) end function tbl_4.Reload(a1) --[[ name: Reload line: 2038 ]] local CurrentTool_14 = a1.CurrentTool assert(CurrentTool_14, "Failed to Reload-0 because no CurrentTool exists") a1.CurrentState = "Reload" CurrentTool_14.Animations.Client.Inspect:Stop() CurrentTool_14.ReloadCancel = false CurrentTool_14.Reloading = true a1:PushRuntimeState("Reload", {Inspecting = false, Reloading = true, Aiming = false, Holstered = a1.Holster}) a1:SendPresentationEvent("ReloadStart", {Aiming = false, Reloading = true, CurrentState = "Reload", Inspecting = false, Holstered = a1.Holster}) CurrentTool_14.Animations.Client.Reload:Play() if CurrentTool_14.Animations.Server.Hold and CurrentTool_14.Animations.Server.Hold.IsPlaying == true then CurrentTool_14.Animations.Server.Hold:Stop() end CurrentTool_14.Animations.Server.Reload:Play() CurrentTool_14.Animations.Client.Reload.Stopped:Wait() CurrentTool_14.Animations.Server.Reload:Stop() CurrentTool_14.Reloading = false if ((a1.CurrentTool == CurrentTool_14) and (CurrentTool_14.ReloadCancel == false)) == true then a1.CurrentState = "Hold" a1:ResumeHoldPresentation(CurrentTool_14) end local CurrentState_6 = a1.CurrentState local tbl_27 = {Holstered = 0, Inspecting = false, Reloading = false, Aiming = 0} tbl_27.Aiming = CurrentTool_14.Aiming == true tbl_27.Holstered = a1.Holster a1:PushRuntimeState(CurrentState_6, tbl_27) end function tbl_4.Action(a1, a2) --[[ name: Action line: 2086 ]] local CurrentTool_upv_15 = a1.CurrentTool assert(CurrentTool_upv_15, "Failed to Action-2 because no CurrentTool exists") if CurrentTool_upv_15.Animations.Client.Action then a1.CurrentState = "Action" local tbl_28 = {Holstered = 0, Inspecting = false, Reloading = false, Aiming = 0} tbl_28.Aiming = CurrentTool_upv_15.Aiming == true tbl_28.Holstered = a1.Holster a1:PushRuntimeState("Action", tbl_28) local tbl_29 = {ActionClass = 0, Aiming = 0, Holstered = 0, Reloading = false, CurrentState = "Action", Inspecting = false} tbl_29.Aiming = CurrentTool_upv_15.Aiming == true tbl_29.Holstered = a1.Holster tbl_29.ActionClass = a2 a1:SendPresentationEvent("ActionStart", tbl_29) if a2 == "Knife" then a1:StopCurrentToolAnimation(true) CurrentTool_upv_15.Animations.Client.Action:Play() CurrentTool_upv_15.Animations.Server.Action:Play() if CurrentTool_upv_15.Model.Handle:FindFirstChild("Action") then CurrentTool_upv_15.Model.Handle:FindFirstChild("Action"):Play() a1:ServerSoundCue("Action", true, CurrentTool_upv_15.Model.Name) end task.spawn( function() --[[ line: 2120 upvalues: CurrentTool_upv_15 (copy, index: 1) a1 (copy, index: 2) ]] CurrentTool_upv_15.Animations.Client.Action.Stopped:Wait() if a1.CurrentTool ~= CurrentTool_upv_15 then return end if a1.CurrentState == "Action" then a1.CurrentState = ((CurrentTool_upv_15.Aiming ~= true) and "Hold") or "ADS" if a1.CurrentState == "Hold" then a1:ResumeHoldPresentation(CurrentTool_upv_15) end local CurrentState_7 = a1.CurrentState local tbl_30 = {Holstered = 0, Inspecting = false, Reloading = 0, Aiming = 0} tbl_30.Aiming = CurrentTool_upv_15.Aiming == true tbl_30.Reloading = CurrentTool_upv_15.Reloading == true tbl_30.Holstered = a1.Holster a1:PushRuntimeState(CurrentState_7, tbl_30) end end ) elseif a2 == "Throwable" then if a1.ActionDebounce == false then a1.ActionDebounce = true local CurrentTool_16 = a1.CurrentTool assert(CurrentTool_16, "Failed to Action because no CurrentTool exists") a1:ToggleToolModelVisible(CurrentTool_16.Model, true) a1:StopCurrentToolAnimation(true) CurrentTool_16.Animations.Client.Action:Play() CurrentTool_16.Animations.Server.Action:Play() if CurrentTool_16.Model.Handle:FindFirstChild("Action") then CurrentTool_16.Model.Handle:FindFirstChild("Action"):Play() a1:ServerSoundCue("Action", true, CurrentTool_16.Model.Name) end CurrentTool_16.Animations.Client.Action.Stopped:Wait() local v126 = (tonumber(CurrentTool_16.Tool:GetAttribute("Amount")) or 0) > 0 a1:ToggleToolModelVisible(CurrentTool_16.Model, v126) a1.ActionDebounce = false if a1.CurrentTool ~= CurrentTool_16 then return end if a1.CurrentState == "Action" then a1.CurrentState = ((CurrentTool_16.Aiming ~= true) and "Hold") or "ADS" if a1.CurrentState == "Hold" then a1:ResumeHoldPresentation(CurrentTool_16) end local CurrentState_8 = a1.CurrentState local tbl_31 = {Holstered = 0, Inspecting = false, Reloading = 0, Aiming = 0} tbl_31.Aiming = CurrentTool_16.Aiming == true tbl_31.Reloading = CurrentTool_16.Reloading == true tbl_31.Holstered = a1.Holster a1:PushRuntimeState(CurrentState_8, tbl_31) end end end end end function tbl_4.StopServerHold(a1) --[[ name: StopServerHold line: 2180 ]] local CurrentTool_17 = a1.CurrentTool if not CurrentTool_17 or not CurrentTool_17.Animations then return end if CurrentTool_17.Animations.Server then local Hold_1 = CurrentTool_17.Animations.Server.Hold if Hold_1 and Hold_1.IsPlaying then Hold_1:Stop(0.12) end end end function tbl_4.PlayServerHold(a1) --[[ name: PlayServerHold line: 2192 ]] local CurrentTool_18 = a1.CurrentTool if not CurrentTool_18 or not CurrentTool_18.Animations then return end if CurrentTool_18.Animations.Server then local Hold_2 = CurrentTool_18.Animations.Server.Hold if Hold_2 and Hold_2.IsPlaying ~= true then Hold_2:Play(0.12) end end end function tbl_4.StopCurrentToolAnimation(a1, a2) --[[ name: StopCurrentToolAnimation line: 2204 ]] local CurrentTool_19 = a1.CurrentTool assert(CurrentTool_19, "Failed to StopCurrentToolAnimation because no CurrentTool exists") for key_4, value_22 in pairs(CurrentTool_19.Animations.Client) do if a2 ~= true or key_4 ~= "Hold" then value_22:Stop() end end for key_5, value_23 in pairs(CurrentTool_19.Animations.Server) do if a2 ~= true or key_5 ~= "Hold" then value_23:Stop() end end for key_6, value_24 in pairs(a1.Animations.Client) do if key_6 ~= "Run" then value_24:Stop() end end end function tbl_4.GetADSZoom(a1, a2) --[[ name: GetADSZoom line: 2231 upvalues: CollectionService_upv_1 (copy, index: 1) ]] local v127 = 1 local v128 = nil v127, v128 = v127, v128 for _, value_25 in pairs(a2:GetChildren()) do local v129 = CollectionService_upv_1:HasTag(value_25, "Sight") if v129 then v127, v128 = value_25:GetAttribute("Zoom"), value_25:FindFirstChild("Front") end end return v127, v128 end function tbl_4.SetFP(a1, a2) --[[ name: SetFP line: 2244 upvalues: UserInputService_upv_1 (copy, index: 1) ]] local ServerData_1 = a2:FindFirstChild("ServerData") assert(ServerData_1, "Failed to SetFP because no ServerData folder exists") local Character_8 = a2.Character assert(Character_8, "Failed to SetFP because no character exists") if ServerData_1:GetAttribute("Alive") ~= true or UserInputService_upv_1.MouseIconEnabled == false and a1.Camera.CameraType == Enum.CameraType.Custom and a1.Camera.CameraSubject == Character_8.Humanoid and a2.CameraMinZoomDistance == 0.5 and a2.CameraMaxZoomDistance == 0.5 then return end UserInputService_upv_1.MouseIconEnabled = false a1.Camera.CameraType = Enum.CameraType.Custom a1.Camera.CameraSubject = Character_8.Humanoid a2.CameraMinZoomDistance = 0.5 a2.CameraMaxZoomDistance = 0.5 end function tbl_4.WeaponRuntime(a1, a2) --[[ name: WeaponRuntime line: 2271 ]] a1.CameraModel.Base.CFrame = a1.Camera.CFrame * CFrame.new(0, 0, -0.5) end return tbl_2