-- ModuleScript HitEffect (via decompile) local Debris_upv_1 = game:GetService("Debris") local ReplicatedStorage_1 = game:GetService("ReplicatedStorage") local CollectionService_upv_1 = game:GetService("CollectionService") local ContentProvider_upv_1 = game:GetService("ContentProvider") local Players_1 = game:GetService("Players") local RunService_upv_1 = game:GetService("RunService") local Map_Cache_upv_1 = game.Workspace.Map_Cache local Config_upv_1 = require(game.ReplicatedStorage.Config) local Server_upv_1 = ReplicatedStorage_1:WaitForChild("Server") local Effects_upv_1 = script.Effects local BulletHoles_upv_1 = script.BulletHoles local LocalPlayer_upv_1 = Players_1.LocalPlayer local tbl_upv_1 = {"Concrete", "Metal", "Sand", "Wood", "Glass", "Water", "ForceField"} local tbl_upv_2 = {Wood = "Wood", Glass = "Glass", ForceField = "ForceField", Sand = "Sand", Explosion = "Explosion", Water = "Water", Whizz = "Whizz", Default = "Concrete", Metal = "Metal", Concrete = "Concrete", Dirt = "Sand", Fabric = "Sand", Hits = "Damage"} local tbl_upv_3 = {} local HitSound_upv_1 = script:WaitForChild("HitSound") local tbl_upv_4 = {} local u1 = nil local function CollectSoundTemplates(a1) --[[ name: CollectSoundTemplates line: 42 ]] local tbl_5 = {} for _, value_1 in ipairs(a1:GetChildren()) do if value_1:IsA("Sound") then table.insert(tbl_5, value_1) end end return tbl_5 end local u2 = (function() --[[ name: BuildImpactSoundTemplateRegistry line: 52 upvalues: HitSound_upv_1 (copy, index: 1) CollectSoundTemplates (copy, index: 2) ]] local tbl_6 = {} for _, value_2 in ipairs(HitSound_upv_1:GetChildren()) do if value_2:IsA("Folder") then tbl_6[value_2.Name] = CollectSoundTemplates(value_2) end end return tbl_6 end)() local u3 = false local u4 = 1 local tbl_upv_7 = {} local function IsBarricadeDamageAllowed() --[[ name: IsBarricadeDamageAllowed line: 67 upvalues: Server_upv_1 (copy, index: 1) ]] if Server_upv_1:GetAttribute("Phase") ~= "Round Started" then return false end local v1 = Server_upv_1:GetAttribute("RoundStartedAt") if typeof(v1) ~= "number" then return true end local v2 = workspace:GetServerTimeNow() - v1 >= 3 return v2 end local function GetNormalizedAudioFolder(a1) --[[ name: GetNormalizedAudioFolder line: 80 upvalues: tbl_upv_2 (copy, index: 1) ]] local v3 = a1 or "Default" return tbl_upv_2[v3] or v3 end local function GetTemplateFallback() --[[ name: GetTemplateFallback line: 85 upvalues: tbl_upv_1 (copy, index: 1) u2 (copy, index: 2) ]] local v4 = nil for _, value_3 in ipairs(tbl_upv_1) do v4 = u2[value_3] if not (v4) or not (#v4 > 0) then continue end return v4[1] end for _, value_4 in pairs(u2) do if not (#value_4 > 0) then continue end return value_4[1] end return nil end local u5 = (function() --[[ name: CollectAllImpactSoundTemplates line: 117 upvalues: u2 (copy, index: 1) ]] local tbl_8 = {} local tbl_9 = {} for _, value_5 in ipairs({"Concrete", "Metal", "Sand", "Wood", "Glass", "Water", "ForceField", "Damage", "Explosion", "Whizz"}) do for v1, value_6 in ipairs(u2[value_5] or {}) do if not (tbl_9[value_6]) then tbl_9[value_6] = true table.insert(tbl_8, value_6) end end end for _, value_7 in pairs(u2) do for v2, value_8 in ipairs(value_7) do if not (tbl_9[value_8]) then tbl_9[value_8] = true table.insert(tbl_8, value_8) end end end return tbl_8 end)() local function GetNextStandbyImpactTemplate() --[[ name: GetNextStandbyImpactTemplate line: 145 upvalues: tbl_upv_1 (copy, index: 1) GetTemplateFallback (copy, index: 2) u4 (ref, index: 3) u2 (copy, index: 4) tbl_upv_7 (copy, index: 5) ]] local v5 = #tbl_upv_1 if not (v5 <= 0) then local v6, v7 = nil, nil for _ = 1, v5 do v6 = tbl_upv_1[u4] u4 = (u4 % v5) + 1 v7 = u2[v6] if not (v7) or not (#v7 > 0) then continue end local v8 = (tbl_upv_7[v6] or 0) % #v7 + 1 tbl_upv_7[v6] = v8 return v7[v8] end end return (GetTemplateFallback()) end local function GetImpactPlaybackSpeed() --[[ name: GetImpactPlaybackSpeed line: 166 upvalues: Config_upv_1 (copy, index: 1) ]] local v9 = Config_upv_1.ImpactSoundPlaybackSpeedMin or 0.95 local v10 = Config_upv_1.ImpactSoundPlaybackSpeedMax or 1.05 if v10 < v9 then v10, v9 = v9, v10 end return v9 + ((v10 - v9) * math.random()) end local function CheckForHumanoid(a1) --[[ name: CheckForHumanoid line: 177 ]] local v11 = ((a1 and (a1.Parent)) and (a1.Parent:FindFirstChild("Humanoid"))) or nil return v11 end local function ShouldUseFakeBlood() --[[ name: ShouldUseFakeBlood line: 181 upvalues: Config_upv_1 (copy, index: 1) ]] return Config_upv_1.DamageFeedbackMode == "FakeBlood" end local function GetMasterVolume() --[[ name: GetMasterVolume line: 196 upvalues: LocalPlayer_upv_1 (copy, index: 1) ]] if LocalPlayer_upv_1 and LocalPlayer_upv_1:FindFirstChild("PlayerData") and LocalPlayer_upv_1.PlayerData:FindFirstChild("Settings") then return LocalPlayer_upv_1.PlayerData.Settings:GetAttribute("MasterVolume") or 1 end return 1 end local function GetShooterBucketId(a1) --[[ name: GetShooterBucketId line: 204 ]] if typeof(a1) ~= "Instance" then return "Shared" elseif a1:IsA("Player") then return "Player_" .. tostring(a1.UserId) else return a1:GetFullName() end end local function GetShooterPool(a1) --[[ name: GetShooterPool line: 216 upvalues: tbl_upv_3 (copy, index: 1) u1 (ref, index: 2) ]] local v12 = ((typeof(a1) ~= "Instance") and "Shared") or (((a1:IsA("Player")) and ("Player_" .. tostring(a1.UserId))) or (a1:GetFullName())) if tbl_upv_3[v12] == nil then tbl_upv_3[v12] = {SoundAnchorCursor = 1, EffectHolderCursor = 1, BulletHoleCursor = 1, SoundAnchorsReady = false, BulletHoles = {}, EffectHolders = {}, SoundAnchors = {}} end local v13 = tbl_upv_3[v12] if u1 ~= nil then u1(v13) end return v13 end local u6 = 0 local function ApplyScriptedImpactSoundSettings(a1) --[[ name: ApplyScriptedImpactSoundSettings line: 254 ]] a1.Name = "Impact" a1.RollOffMaxDistance = 80 a1.RollOffMinDistance = 8 a1.RollOffMode = Enum.RollOffMode.InverseTapered a1.EmitterSize = 3 a1:SetAttribute("__ImpactSound", true) end local function ApplyImpactTemplateToSound(a1, a2) --[[ name: ApplyImpactTemplateToSound line: 263 ]] a1:Stop() a1.TimePosition = 0 a1.SoundId = a2.SoundId a1.Volume = a2.Volume a1.Looped = false a1.Name = "Impact" a1.RollOffMaxDistance = 80 a1.RollOffMinDistance = 8 a1.RollOffMode = Enum.RollOffMode.InverseTapered a1.EmitterSize = 3 a1:SetAttribute("__ImpactSound", true) a1:SetAttribute("__ImpactBaseVolume", a2.Volume) a1:SetAttribute("__ImpactTemplateId", a2.SoundId) end local function CreateConfiguredImpactSound(a1) --[[ name: CreateConfiguredImpactSound line: 274 ]] local v14 = a1:Clone() v14:Stop() v14.TimePosition = 0 v14.SoundId = a1.SoundId v14.Volume = a1.Volume v14.Looped = false v14.Name = "Impact" v14.RollOffMaxDistance = 80 v14.RollOffMinDistance = 8 v14.RollOffMode = Enum.RollOffMode.InverseTapered v14.EmitterSize = 3 v14:SetAttribute("__ImpactSound", true) v14:SetAttribute("__ImpactBaseVolume", a1.Volume) v14:SetAttribute("__ImpactTemplateId", a1.SoundId) return v14 end local function BindPooledSound(a1) --[[ name: BindPooledSound line: 238 ]] if a1:GetAttribute("__ImpactSoundBound") == true then return end a1:SetAttribute("__ImpactSoundBound", true) a1.Ended:Connect( function() --[[ line: 244 upvalues: a1 (copy, index: 1) ]] if not a1.Parent then return end a1:SetAttribute("Playing", false) a1.TimePosition = 0 end ) end local function EnsureImpactSoundInstance(a1, a2) --[[ name: EnsureImpactSoundInstance line: 307 upvalues: BindPooledSound (copy, index: 1) ]] local v15 = a1.Sound if v15 == nil or v15.Parent ~= a1.Part then local Impact_1 = a1.Part:FindFirstChild("Impact") if (Impact_1) and (Impact_1:IsA("Sound")) then BindPooledSound(Impact_1) v15 = Impact_1 else v15 = a2:Clone() v15:Stop() v15.TimePosition = 0 v15.SoundId = a2.SoundId v15.Volume = a2.Volume v15.Looped = false v15.Name = "Impact" v15.RollOffMaxDistance = 80 v15.RollOffMinDistance = 8 v15.RollOffMode = Enum.RollOffMode.InverseTapered v15.EmitterSize = 3 v15:SetAttribute("__ImpactSound", true) v15:SetAttribute("__ImpactBaseVolume", a2.Volume) v15:SetAttribute("__ImpactTemplateId", a2.SoundId) v15.Parent = a1.Part BindPooledSound(v15) end a1.Sound = v15 end v15:Stop() v15.TimePosition = 0 v15.SoundId = a2.SoundId v15.Volume = a2.Volume v15.Looped = false v15.Name = "Impact" v15.RollOffMaxDistance = 80 v15.RollOffMinDistance = 8 v15.RollOffMode = Enum.RollOffMode.InverseTapered v15.EmitterSize = 3 v15:SetAttribute("__ImpactSound", true) v15:SetAttribute("__ImpactBaseVolume", a2.Volume) v15:SetAttribute("__ImpactTemplateId", a2.SoundId) return v15 end local u7 = function() --[[ line: 326 upvalues: RunService_upv_1 (copy, index: 1) u3 (ref, index: 2) Config_upv_1 (copy, index: 3) u5 (copy, index: 4) ContentProvider_upv_1 (copy, index: 5) ]] if not RunService_upv_1:IsClient() then return end if u3 ~= true and Config_upv_1.ImpactSoundPreloadEnabled ~= false then u3 = true if not (#u5 <= 0) then task.spawn( function() --[[ line: 341 upvalues: ContentProvider_upv_1 (copy, index: 1) u5 (copy, index: 2) ]] pcall( function() --[[ line: 342 upvalues: ContentProvider_upv_1 (copy, index: 1) u5 (copy, index: 2) ]] ContentProvider_upv_1:PreloadAsync(u5) end ) end ) end return end u3 = true end local function CreateSoundAnchorEntry(a1) --[[ name: CreateSoundAnchorEntry line: 280 upvalues: Map_Cache_upv_1 (copy, index: 1) BindPooledSound (copy, index: 2) ]] local v16 = Instance.new("Part") v16.Name = "ImpactSoundAnchor" v16.Size = Vector3.new(0.10000000149011612, 0.10000000149011612, 0.10000000149011612) v16.Transparency = 1 v16.Anchored = true v16.CanCollide = false v16.CanTouch = false v16.CanQuery = false v16.CastShadow = false v16.Parent = Map_Cache_upv_1 local tbl_10 = {} tbl_10.Part = v16 if a1 ~= nil then local v17 = a1:Clone() v17:Stop() v17.TimePosition = 0 v17.SoundId = a1.SoundId v17.Volume = a1.Volume v17.Looped = false v17.Name = "Impact" v17.RollOffMaxDistance = 80 v17.RollOffMinDistance = 8 v17.RollOffMode = Enum.RollOffMode.InverseTapered v17.EmitterSize = 3 v17:SetAttribute("__ImpactSound", true) v17:SetAttribute("__ImpactBaseVolume", a1.Volume) v17:SetAttribute("__ImpactTemplateId", a1.SoundId) v17.Parent = v16 BindPooledSound(v17) tbl_10.Sound = v17 end return tbl_10 end u1 = function(a1) --[[ line: 348 upvalues: RunService_upv_1 (copy, index: 1) u7 (ref, index: 2) Config_upv_1 (copy, index: 3) GetNextStandbyImpactTemplate (copy, index: 4) CreateSoundAnchorEntry (copy, index: 5) ContentProvider_upv_1 (copy, index: 6) ]] if not RunService_upv_1:IsClient() or a1.SoundAnchorsReady == true then return end u7() local v18 = Config_upv_1.ImpactSoundPoolSize or 4 local v19 = math.min(Config_upv_1.ImpactSoundStandbyPoolSize or v18, v18) local tbl_upv_11 = {} while #a1.SoundAnchors < v19 do local v20 = GetNextStandbyImpactTemplate() local v21 if v20 == nil then break end v21 = CreateSoundAnchorEntry(v20) table.insert(a1.SoundAnchors, v21) if v21.Sound then table.insert(tbl_upv_11, v21.Sound) end end a1.SoundAnchorsReady = true if not (#tbl_upv_11 > 0) or Config_upv_1.ImpactSoundPreloadEnabled == false then return end task.spawn( function() --[[ line: 375 upvalues: ContentProvider_upv_1 (copy, index: 1) tbl_upv_11 (copy, index: 2) ]] pcall( function() --[[ line: 376 upvalues: ContentProvider_upv_1 (copy, index: 1) tbl_upv_11 (copy, index: 2) ]] ContentProvider_upv_1:PreloadAsync(tbl_upv_11) end ) end ) end local function AcquireImpactSoundAnchor(a1, a2) --[[ name: AcquireImpactSoundAnchor line: 383 upvalues: GetShooterPool (copy, index: 1) Config_upv_1 (copy, index: 2) CreateSoundAnchorEntry (copy, index: 3) ]] local v22 = GetShooterPool(a1) local v23 = nil local v24 = nil local v25 = nil local v26 = math.huge local SoundId_1 = a2.SoundId for _, value_9 in ipairs(v22.SoundAnchors) do local Sound_1 = value_9.Sound if (Sound_1 == nil or Sound_1.Parent ~= value_9.Part) and v24 == nil then v24 = value_9 continue end if Sound_1:GetAttribute("Playing") ~= true then local v27 = Sound_1:GetAttribute("__ImpactTemplateId") or (Sound_1.SoundId) if v23 == nil and v27 == SoundId_1 then v23 = value_9 end if v24 == nil then v24 = value_9 end else local v28 = Sound_1:GetAttribute("__LastPlaySerial") or 0 if v25 == nil or v28 < v26 then v25, v26 = value_9, v28 end end end if v23 then return v23 end if v24 then return v24 end if not (#v22.SoundAnchors < (Config_upv_1.ImpactSoundPoolSize or 4)) then return v25 end local v29 = CreateSoundAnchorEntry(a2) table.insert(v22.SoundAnchors, v29) return v29 end local function PlayImpactSound(a1, a2, a3) --[[ name: PlayImpactSound line: 432 upvalues: u7 (ref, index: 1) AcquireImpactSoundAnchor (copy, index: 2) EnsureImpactSoundInstance (copy, index: 3) Config_upv_1 (copy, index: 4) LocalPlayer_upv_1 (copy, index: 5) u6 (ref, index: 6) ]] if a1 == nil then return end if a2 ~= nil then u7() local v30 = AcquireImpactSoundAnchor(a3, a2) if v30 == nil then return end local Part_1 = v30.Part if a1:IsA("BasePart") then Part_1.CFrame = a1.CFrame elseif a1:IsA("Attachment") and a1.Parent and a1.Parent:IsA("BasePart") then Part_1.CFrame = a1.Parent.CFrame end local u8 = EnsureImpactSoundInstance(v30, a2) local v31 = u8:GetAttribute("__ImpactBaseVolume") or (a2.Volume or 1) local v32 = v31 * (Config_upv_1.ImpactSoundVolumeMultiplier or 1) v31 = LocalPlayer_upv_1 and LocalPlayer_upv_1:FindFirstChild("PlayerData") and LocalPlayer_upv_1.PlayerData:FindFirstChild("Settings") and LocalPlayer_upv_1.PlayerData.Settings:GetAttribute("MasterVolume") or 1 u8.Volume = v32 * v31 local v33 = Config_upv_1.ImpactSoundPlaybackSpeedMin or 0.95 local v34 = Config_upv_1.ImpactSoundPlaybackSpeedMax or 1.05 if v34 < v33 then v34, v33 = v33, v34 end u8.PlaybackSpeed = v33 + ((v34 - v33) * math.random()) u6 = u6 + 1 u8:SetAttribute("__LastPlaySerial", u6) u8:SetAttribute("Playing", true) u8:Play() task.delay( math.max(u8.TimeLength / math.max(u8.PlaybackSpeed, 0.05), 0.05), function() --[[ line: 459 upvalues: u8 (copy, index: 1) ]] if not u8.Parent or u8.IsPlaying == true then return end u8:SetAttribute("Playing", false) u8.TimePosition = 0 end ) end end local function PlayDeployableBreakSound(a1) --[[ name: PlayDeployableBreakSound line: 475 upvalues: Config_upv_1 (copy, index: 1) ]] local v35 = Config_upv_1.AddSound("DeployableBreak", nil, false, a1, false) if v35 then v35.RollOffMinDistance = 8 v35.RollOffMaxDistance = 80 v35.RollOffMode = Enum.RollOffMode.InverseTapered v35.EmitterSize = 3 end return v35 end local function CreateEffectHolderEntry() --[[ name: CreateEffectHolderEntry line: 499 upvalues: Map_Cache_upv_1 (copy, index: 1) ]] local v36 = Instance.new("Part") v36.Name = "ImpactEffect" v36.Size = Vector3.new(0.10000000149011612, 0.10000000149011612, 0.10000000149011612) v36.Transparency = 1 v36.Anchored = true v36.CanCollide = false v36.Parent = Map_Cache_upv_1 local tbl_12 = {} tbl_12.Part = v36 return tbl_12 end local function AcquireEffectHolder(a1) --[[ name: AcquireEffectHolder line: 512 upvalues: GetShooterPool (copy, index: 1) Config_upv_1 (copy, index: 2) Map_Cache_upv_1 (copy, index: 3) ]] local v37 = GetShooterPool(a1) local v38 = Config_upv_1.ImpactEffectPerShooterCap or 12 if #v37.EffectHolders < v38 then local v39 = Instance.new("Part") v39.Name = "ImpactEffect" v39.Size = Vector3.new(0.10000000149011612, 0.10000000149011612, 0.10000000149011612) v39.Transparency = 1 v39.Anchored = true v39.CanCollide = false v39.Parent = Map_Cache_upv_1 local tbl_13 = {} tbl_13.Part = v39 table.insert(v37.EffectHolders, tbl_13) return tbl_13 else local v40 = v37.EffectHolders[v37.EffectHolderCursor] v37.EffectHolderCursor = (v37.EffectHolderCursor % v38) + 1 return v40 end end local function GetRandomBulletHoleTemplate() --[[ name: GetRandomBulletHoleTemplate line: 527 upvalues: BulletHoles_upv_1 (copy, index: 1) ]] local v41 = BulletHoles_upv_1:GetChildren() return v41[math.random(1, #v41)] end local function CreateBulletHoleEntry() --[[ name: CreateBulletHoleEntry line: 532 upvalues: Map_Cache_upv_1 (copy, index: 1) BulletHoles_upv_1 (copy, index: 2) ]] local v42 = Instance.new("Part") v42.Name = "BulletHole" v42.Size = Vector3.new(0.15000000596046448, 0.15000000596046448, 0.029999999329447746) v42.Transparency = 1 v42.CanCollide = false v42.Anchored = false v42.Parent = Map_Cache_upv_1 local tbl_14 = BulletHoles_upv_1:GetChildren() local v43 = tbl_14[math.random(1, #tbl_14)]:Clone() v43.Face = Enum.NormalId.Front v43.Parent = v42 tbl_14 = {} tbl_14.Part = v42 tbl_14.Decal = v43 return tbl_14 end local function AcquireBulletHoleEntry(a1) --[[ name: AcquireBulletHoleEntry line: 551 upvalues: GetShooterPool (copy, index: 1) Config_upv_1 (copy, index: 2) CreateBulletHoleEntry (copy, index: 3) ]] local v44 = GetShooterPool(a1) local v45 = Config_upv_1.BulletHolePerShooterCap or 16 if #v44.BulletHoles < v45 then local v46 = CreateBulletHoleEntry() table.insert(v44.BulletHoles, v46) return v46 else local v47 = v44.BulletHoles[v44.BulletHoleCursor] v44.BulletHoleCursor = (v44.BulletHoleCursor % v45) + 1 return v47 end end function tbl_upv_4.Hit(a1, a2, a3, a4, a5, a6) --[[ name: Hit line: 586 upvalues: Config_upv_1 (copy, index: 1) LocalPlayer_upv_1 (copy, index: 2) tbl_upv_4 (copy, index: 3) ]] if a1 == nil then return nil end local v48 = ((a1 and (a1.Parent)) and (a1.Parent:FindFirstChild("Humanoid"))) or nil if v48 then Config_upv_1.AddSound("HitMarker", nil, true, a1, false) if Config_upv_1.DamageFeedbackMode == "FakeBlood" == true or LocalPlayer_upv_1.PlayerData.Settings:GetAttribute("Bleed") ~= true then return end tbl_upv_4.CreateEffect("Blood", a2, a1, a3, a5, a6) else local v49 = tbl_upv_4.FindEffect(a4) local v50 = tbl_upv_4.CreateEffect(v49, a2, a1, a3, a5, a6) if LocalPlayer_upv_1.PlayerData.Settings:GetAttribute("BulletHoles") ~= true or a5 then tbl_upv_4.CreateSfx(v49, v50, a5, a6) else tbl_upv_4.CreateSfx(v49, tbl_upv_4.AddBulletHole(a1, a2, a3, a4, a6) or v50, a5, a6) end tbl_upv_4.MapInteraction(a1) end end local function FindTaggedAncestor(a1, a2) --[[ name: FindTaggedAncestor line: 185 upvalues: CollectionService_upv_1 (copy, index: 1) ]] local v51 = a1 while v51 and v51 ~= workspace do if not (CollectionService_upv_1:HasTag(v51, a2)) then v51 = v51.Parent continue end return v51 end return nil end function tbl_upv_4.SHit(a1, a2, a3, a4) --[[ name: SHit line: 615 upvalues: Server_upv_1 (copy, index: 1) FindTaggedAncestor (copy, index: 2) Config_upv_1 (copy, index: 3) Debris_upv_1 (copy, index: 4) ]] if a1 == nil or a1.Parent == nil then return nil end local Parent_1 = a1.Parent if a1.Name == "BarricadePlank" and a1:GetAttribute("Health") then local v52 if Server_upv_1:GetAttribute("Phase") == "Round Started" then local v53 = Server_upv_1:GetAttribute("RoundStartedAt") v52 = ((typeof(v53) ~= "number") and true) or (workspace:GetServerTimeNow() - v53 >= 3) else v52 = false end if v52 ~= true then return nil end local v54 = a1:GetAttribute("Health") if not (v54 <= 0) then local v55 = nil if a2 then a1:SetAttribute("Health", 0) else local v56 = a4 v55 = v56 and (a4:GetAttribute("PlankAmount")) local v57 = a4 and (a4:GetAttribute("DamagePerPlank")) local v58 = nil local v59 = nil if a4 and (typeof(a4) ~= "number" or typeof(v57) ~= "number") then v58 = a4:FindFirstChild("Settings") if v58 then v59 = v58:IsA("ModuleScript") if v59 then local v60 v59, v60 = pcall(require, v58) if v59 then if typeof(v60) ~= "table" then v55 = a4 else if typeof(a4) == "number" then v55 = a4 else v55 = v60.PlankAmount end if typeof(v57) ~= "number" then v57 = v60.DamagePerPlank end end else v55 = a4 end else v55 = a4 end else v55 = a4 end end if typeof(v55) == "number" and (v55) then v59 = v55 else v59 = 1 end v55 = math.max(v59, 1) if typeof(v57) == "number" and (v57) then v59 = v57 else v59 = 2 end local v61 = math.max(v59, 1) a1:SetAttribute("Health", (math.clamp(v54 - v61, 0, 3))) if v55 > 1 then local tbl_15 = {} for _, value_10 in pairs(Parent_1:GetChildren()) do if value_10 == a1 or value_10.Name ~= "BarricadePlank" then continue end if (value_10:GetAttribute("Health") or 0) > 0 then table.insert(tbl_15, value_10) end end table.sort( tbl_15, function(a5, a6) --[[ line: 666 upvalues: a1 (copy, index: 1) ]] return (a5.Position - a1.Position).Magnitude < (a6.Position - a1.Position).Magnitude end ) for key_1, value_11 in ipairs(tbl_15) do if not (key_1 <= v55 - 1) then continue end local v62 = value_11:GetAttribute("Health") or 0 if v62 > 0 then value_11:SetAttribute("Health", (math.clamp(v62 - v61, 0, 3))) end end end end end return nil else local v63 = nil if a1.Name ~= "Glass_Breakable" then v63 = FindTaggedAncestor(a1, "Deployable") local v64, v65 = nil, nil if v63 then v64 = v63:GetAttribute("Health") if v64 == nil or v64 <= 0 then return nil end local v66 = math.max(v64 - 1, 0) v63:SetAttribute("Health", v66) if v66 <= 0 then local v67 = v63.PrimaryPart or (v63:FindFirstChildWhichIsA("BasePart")) local v68 = nil if v67 then v67.Parent = game.Workspace.Map_Cache v68 = Config_upv_1.AddSound("DeployableBreak", nil, false, v67, false) if v68 then v68.RollOffMinDistance = 8 v68.RollOffMaxDistance = 80 v68.RollOffMode = Enum.RollOffMode.InverseTapered v68.EmitterSize = 3 end Debris_upv_1:AddItem(v67, 2) v64 = v67 else v64 = v63 end v63:Destroy() else v64 = v63 end local tbl_16 = {Kind = "Deployable", ForceFeedback = false, Destroyed = 0} tbl_16.Target = v64 tbl_16.Destroyed = v66 <= 0 return tbl_16 else v65 = FindTaggedAncestor(a1, "Proximity Alarm") if not v65 then return nil end v64 = v65:GetAttribute("Health") if v64 == nil or v64 <= 0 then return nil end local v69 = math.max(v64 - 1, 0) v65:SetAttribute("Health", v69) local v70 = nil if v69 <= 0 then v70 = v65:FindFirstChild("Base") if v70 then v70.Parent = game.Workspace.Map_Cache local v71 = Config_upv_1.AddSound("DeployableBreak", nil, false, v70, false) if v71 then v71.RollOffMinDistance = 8 v71.RollOffMaxDistance = 80 v71.RollOffMode = Enum.RollOffMode.InverseTapered v71.EmitterSize = 3 end if v70:FindFirstChild("Break") then v70.Break:Play() end for _, value_12 in pairs(v70:GetChildren()) do if value_12.Name == "Explosion" then value_12:Emit(5) end end v65:Destroy() Debris_upv_1:AddItem(v70, 2) v64 = v70 local tbl_17 = {Kind = "Proximity Alarm", ForceFeedback = true, Destroyed = 0} tbl_17.Target = v64 tbl_17.Destroyed = v69 <= 0 return tbl_17 end v65:Destroy() return nil else v64 = v65 local tbl_17 = {Kind = "Proximity Alarm", ForceFeedback = true, Destroyed = 0} tbl_17.Target = v64 tbl_17.Destroyed = v69 <= 0 return tbl_17 end end else if a1:GetAttribute("Broken") ~= true then a1:SetAttribute("Broken", true) a1.Transparency = 1 a1.CanCollide = false for _, value_13 in a1:GetChildren() do if value_13:IsA("Decal") then value_13.Transparency = 1 end end end return nil end end end function tbl_upv_4.AddEffectOnly(a1, a2) --[[ name: AddEffectOnly line: 772 upvalues: Debris_upv_1 (copy, index: 1) ]] local v72 = a1:Clone() v72.Parent = a2 v72:Emit(v72.Rate / 10) Debris_upv_1:AddItem(v72, v72.Lifetime.Max) end function tbl_upv_4.AddEffectPack(a1, a2) --[[ name: AddEffectPack line: 782 ]] if a1.Name == "Light_Explode" then local u9 = a1:Clone() u9.Parent = a2 u9.CFrame = a2.CFrame u9.Smoke.Enabled = true u9.Explode:Play() for _, value_14 in pairs(u9:GetChildren()) do if value_14.Name == "Metal" then value_14:Emit(value_14.Rate / 10) end end coroutine.resume( coroutine.create( function() --[[ line: 799 upvalues: u9 (copy, index: 1) ]] wait(math.random(1, 15)) u9.Spark.PlaybackSpeed = math.random(20, 40) / 10 u9.Spark:Play() for _, value_15 in pairs(u9:GetChildren()) do if value_15.Name == "Metal" then value_15:Emit(value_15.Rate / 10) end end end ) ) end end function tbl_upv_4.MapInteraction(a1) --[[ name: MapInteraction line: 816 upvalues: CollectionService_upv_1 (copy, index: 1) tbl_upv_4 (copy, index: 2) ]] if a1 == nil then return end if CollectionService_upv_1:HasTag(a1.Parent, "TargetBoard") then if a1.Parent:GetAttribute("Hit") ~= false then return end a1.Parent:SetAttribute("Hit", true) elseif a1.Name == "Glass_Breakable" then a1.Transparency = 1 a1.Name = "Glass_Broke" a1.CanCollide = false tbl_upv_4.AddEffectOnly(script.MapInteraction.Glass_1, a1) elseif a1.Name == "Light_Breakable" then a1.Name = "Light_Broke" a1.Color = Color3.fromRGB(0, 0, 0) for _, value_16 in pairs(a1:GetChildren()) do if value_16:IsA("SpotLight") or value_16:IsA("SurfaceLight") or value_16:IsA("PointLight") then value_16.Enabled = false end end tbl_upv_4.AddEffectPack(script.MapInteraction.Light_Explode, a1) end end local function ClearEffectHolderChildren(a1) --[[ name: ClearEffectHolderChildren line: 486 ]] for _, value_17 in a1:GetChildren() do if (value_17:IsA("Sound")) and value_17:GetAttribute("__ImpactSound") == true then value_17:Stop() value_17.TimePosition = 0 value_17:SetAttribute("Playing", false) else value_17:Destroy() end end end function tbl_upv_4.CreateEffect(a1, a2, a3, a4, a5, a6) --[[ name: CreateEffect line: 849 upvalues: GetShooterPool (copy, index: 1) Config_upv_1 (copy, index: 2) Map_Cache_upv_1 (copy, index: 3) ClearEffectHolderChildren (copy, index: 4) Effects_upv_1 (copy, index: 5) ]] local Settings_1 = game.Players.LocalPlayer:WaitForChild("PlayerData"):WaitForChild("Settings") local v73 = GetShooterPool(a6) local v74 = Config_upv_1.ImpactEffectPerShooterCap or 12 local v75 if #v73.EffectHolders < v74 then local v76 = Instance.new("Part") v76.Name = "ImpactEffect" v76.Size = Vector3.new(0.10000000149011612, 0.10000000149011612, 0.10000000149011612) v76.Transparency = 1 v76.Anchored = true v76.CanCollide = false v76.Parent = Map_Cache_upv_1 local tbl_18 = {} tbl_18.Part = v76 table.insert(v73.EffectHolders, tbl_18) v75 = tbl_18 else local v77 = v73.EffectHolders[v73.EffectHolderCursor] v73.EffectHolderCursor = (v73.EffectHolderCursor % v74) + 1 v75 = v77 end local Part_upv_2 = v75.Part local u10 = (Part_upv_2:GetAttribute("__PoolToken") or 0) + 1 ClearEffectHolderChildren(Part_upv_2) Part_upv_2:SetAttribute("__PoolToken", u10) Part_upv_2.CFrame = CFrame.new(a2, a2 + a4) if a1 == "Blood" then a1 = ((a3.Name ~= "Head") and "BloodDefault") or "BloodHead" end local tbl_19 = {} for _, value_18 in pairs(Effects_upv_1:GetChildren()) do if value_18.Name == a1 then table.insert(tbl_19, value_18) end end if #tbl_19 <= 0 then table.insert(tbl_19, Effects_upv_1.Default) end if a1 ~= "BloodHead" and a1 ~= "BloodDefault" then if not (a5) then table.insert(tbl_19, Effects_upv_1.Spark) end table.insert(tbl_19, Effects_upv_1.Smoke) end local v78 = 0 local v79 = nil local v80 = v78 for _, value_19 in pairs(tbl_19) do local v81 = value_19:Clone() if a1 ~= "Metal" and a1 ~= "Default" and value_19.Name ~= "Spark" and value_19.Name ~= "Blood" and value_19.Name ~= "BloodDefault" and value_19.Name ~= "BloodHead" then v81.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, a3.Color), ColorSequenceKeypoint.new(1, a3.Color)}) end v81.Parent = Part_upv_2 v79 = math.floor(v81.Rate / 10) if Settings_1:GetAttribute("Graphics") == "Performance" then v79 = 2 end v81:Emit(v79) if v80 < v81.Lifetime.Max then v80 = v81.Lifetime.Max end end task.delay( v80 + 0.5, function() --[[ line: 907 upvalues: Part_upv_2 (copy, index: 1) u10 (copy, index: 2) ClearEffectHolderChildren (copy, index: 3) ]] if not Part_upv_2.Parent or Part_upv_2:GetAttribute("__PoolToken") ~= u10 then return end ClearEffectHolderChildren(Part_upv_2) end ) return Part_upv_2 end local function GetSoundTemplatesForCategory(a1) --[[ name: GetSoundTemplatesForCategory line: 102 upvalues: tbl_upv_2 (copy, index: 1) u2 (copy, index: 2) GetTemplateFallback (copy, index: 3) ]] local v82 = a1 or "Default" v82 = u2[tbl_upv_2[v82] or v82] if v82 and #v82 > 0 then return v82 end local v83 = GetTemplateFallback() if v83 then return {v83} end return {} end function tbl_upv_4.CreateSfx(a1, a2, a3, a4) --[[ name: CreateSfx line: 917 upvalues: GetSoundTemplatesForCategory (copy, index: 1) PlayImpactSound (copy, index: 2) ]] if not a2 or a3 and (not a3 or a1 ~= "Glass") then return end local v84 = GetSoundTemplatesForCategory(a1) if (#v84 <= 0) then return end PlayImpactSound(a2, v84[math.random(1, #v84)], a4) end local function ShouldHideBulletHole(a1, a2) --[[ name: ShouldHideBulletHole line: 566 upvalues: CollectionService_upv_1 (copy, index: 1) ]] if a2 ~= Enum.Material.Water and a2 ~= Enum.Material.ForceField then if a1.Name ~= "BarricadePlank" and a1.Name ~= "Glass_Breakable" then if not (CollectionService_upv_1:HasTag(a1.Parent, "Barbwire")) and not (CollectionService_upv_1:HasTag(a1.Parent, "Trip Wire")) then if a1.Size.Z <= 0.16 and a1.Size.Y <= 0.16 and a1.Size.X <= 0.16 then return true end return false end return true end return true end return true end local function CleanupWelds(a1) --[[ name: CleanupWelds line: 467 ]] for _, value_20 in a1:GetChildren() do if value_20:IsA("WeldConstraint") then value_20:Destroy() end end end function tbl_upv_4.AddBulletHole(a1, a2, a3, a4, a5) --[[ name: AddBulletHole line: 933 upvalues: CollectionService_upv_1 (copy, index: 1) GetShooterPool (copy, index: 2) Config_upv_1 (copy, index: 3) CreateBulletHoleEntry (copy, index: 4) CleanupWelds (copy, index: 5) BulletHoles_upv_1 (copy, index: 6) ShouldHideBulletHole (copy, index: 7) ]] local Settings_2 = game.Players.LocalPlayer:WaitForChild("PlayerData"):WaitForChild("Settings") local Part_upv_3 = nil local u11 = CollectionService_upv_1:HasTag(a1.Parent, "Event Prop") if not (u11) and a4 ~= Enum.Material.Water and a4 ~= Enum.Material.ForceField then local v85, v86 = nil, nil if Settings_2:GetAttribute("Graphics") ~= "Performance" then v85 = GetShooterPool(a5) v86 = Config_upv_1.BulletHolePerShooterCap or 16 if #v85.BulletHoles < v86 then local v87 = CreateBulletHoleEntry() table.insert(v85.BulletHoles, v87) u11 = v87 else local v88 = v85.BulletHoles[v85.BulletHoleCursor] v85.BulletHoleCursor = (v85.BulletHoleCursor % v86) + 1 u11 = v88 end Part_upv_3 = u11.Part local Decal_upv_1 = u11.Decal u11 = (Part_upv_3:GetAttribute("__PoolToken") or 0) + 1 CleanupWelds(Part_upv_3) Part_upv_3.CFrame = CFrame.new(a2, a2 + a3) Part_upv_3.AssemblyLinearVelocity = Vector3.new(0, 0, 0) Part_upv_3.AssemblyAngularVelocity = Vector3.new(0, 0, 0) Config_upv_1.WeldObject(Part_upv_3, a1, Part_upv_3) local v89 = BulletHoles_upv_1:GetChildren() Decal_upv_1.Texture = v89[math.random(1, #v89)].Texture Decal_upv_1.Transparency = ShouldHideBulletHole(a1, a4) and 1 or 0 Decal_upv_1.Face = Enum.NormalId.Front Part_upv_3:SetAttribute("__PoolToken", u11) task.delay( Config_upv_1.BulletHoleDespawnTime, function() --[[ line: 956 upvalues: Part_upv_3 (ref, index: 1) u11 (copy, index: 2) Config_upv_1 (copy, index: 3) Decal_upv_1 (copy, index: 4) ]] if not Part_upv_3.Parent or Part_upv_3:GetAttribute("__PoolToken") ~= u11 then return end Config_upv_1.TweenOnce(Decal_upv_1, {Transparency = 1}, 1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, false) end ) end end return Part_upv_3 end function tbl_upv_4.ThreeDimensionEffect(a1, a2, a3) --[[ name: ThreeDimensionEffect line: 966 ]] return nil end function tbl_upv_4.FindEffect(a1) --[[ name: FindEffect line: 970 ]] if a1 ~= Enum.Material.Mud and a1 ~= Enum.Material.Grass and a1 ~= Enum.Material.Ground and a1 ~= Enum.Material.LeafyGrass then if a1 ~= Enum.Material.Metal and a1 ~= Enum.Material.CorrodedMetal and a1 ~= Enum.Material.DiamondPlate and a1 ~= Enum.Material.SmoothPlastic then if a1 ~= Enum.Material.Fabric then if a1 ~= Enum.Material.Sand and a1 ~= Enum.Material.Sandstone and a1 ~= Enum.Material.Snow and a1 ~= Enum.Material.Salt then if a1 ~= Enum.Material.Wood and a1 ~= Enum.Material.WoodPlanks then if a1 ~= Enum.Material.Concrete and a1 ~= Enum.Material.Slate and a1 ~= Enum.Material.Basalt and a1 ~= Enum.Material.Asphalt and a1 ~= Enum.Material.Rock and a1 ~= Enum.Material.Cobblestone and a1 ~= Enum.Material.Marble then if a1 ~= Enum.Material.Glass and a1 ~= Enum.Material.Glacier and a1 ~= Enum.Material.Ice and a1 ~= Enum.Material.Foil then if a1 ~= Enum.Material.Water then if a1 ~= Enum.Material.ForceField then return "Default" end return "ForceField" end return "Water" end return "Glass" end return "Concrete" end return "Wood" end return "Sand" end return "Fabric" end return "Metal" end return "Dirt" end if RunService_upv_1:IsClient() then u7() task.defer( function() --[[ line: 997 upvalues: LocalPlayer_upv_1 (copy, index: 1) GetShooterPool (copy, index: 2) ]] if LocalPlayer_upv_1 ~= nil then GetShooterPool(LocalPlayer_upv_1) end GetShooterPool(nil) end ) end return tbl_upv_4