From 85a7e1360aed6482dff504d983cff1a73f9ed177 Mon Sep 17 00:00:00 2001 From: edshot99 Date: Sat, 21 Dec 2024 13:37:22 -0600 Subject: [PATCH] nuke sfx --- player_stats/lua/autorun/client/cl_stats.lua | 8 ++++++++ player_stats/lua/autorun/server/sv_stats.lua | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/player_stats/lua/autorun/client/cl_stats.lua b/player_stats/lua/autorun/client/cl_stats.lua index 3611b56..b5343da 100644 --- a/player_stats/lua/autorun/client/cl_stats.lua +++ b/player_stats/lua/autorun/client/cl_stats.lua @@ -6,6 +6,8 @@ local StatsPanel = {} local X = 0 local Y = 0 +local NUKE_SFX = "readyforlaunch.mp3" + function StatsPanel:Init() local TextColor = Color(255, 255, 255) local TextFont = "ChatFont" @@ -102,3 +104,9 @@ end hook.Add("PopulateToolMenu", "edshot_player_stats_panel_config", function() spawnmenu.AddToolMenuOption("Options", "Player", "edshot_player_stats_panel_config", "Statistics", "", "", StatsPanelConfig) end) + +net.Receive("edshot_player_stats_killstreak_sfx", function() + if net.ReadBool() then + surface.PlaySound(NUKE_SFX) + end +end) diff --git a/player_stats/lua/autorun/server/sv_stats.lua b/player_stats/lua/autorun/server/sv_stats.lua index aae9f87..110d4a4 100644 --- a/player_stats/lua/autorun/server/sv_stats.lua +++ b/player_stats/lua/autorun/server/sv_stats.lua @@ -2,6 +2,8 @@ local NUKE_KILLSTREAK = 25 local NUKE_SWEP = "m9k_orbital_strike" +util.AddNetworkString("edshot_player_stats_killstreak_sfx") + hook.Add("PlayerDeath", "edshot_player_stats_killstreak", function(victim, inflictor, attacker) if IsValid(attacker) and attacker:IsPlayer() then local deaths = attacker:Deaths() @@ -26,6 +28,10 @@ hook.Add("PlayerDeath", "edshot_player_stats_killstreak", function(victim, infli if (k1 ~= 0) and (k2 == k1) then attacker:Give(NUKE_SWEP) + + net.Start("edshot_player_stats_killstreak_sfx") + net.WriteBool(true) + net.Send(attacker) end end end