diff --git a/lua/sv_specdm_overrides.lua b/lua/sv_specdm_overrides.lua index c626cb7..17878ec 100644 --- a/lua/sv_specdm_overrides.lua +++ b/lua/sv_specdm_overrides.lua @@ -47,9 +47,7 @@ hook.Add("PlayerSpawn", "PlayerSpawn_SpecDM", function(ply) if ply:IsGhost() then ply.has_spawned = true ply:UnSpectate() - if IsValid(ply) and ply:IsGhost() and ply:GetWeapons() == nil then - ply:GiveGhostWeapons() - end + ply:GiveGhostWeapons() hook.Call("PlayerSetModel", GAMEMODE, ply) end end) diff --git a/lua/weapons/weapon_ghost_base.lua b/lua/weapons/weapon_ghost_base.lua index 6dfc60f..192d67e 100644 --- a/lua/weapons/weapon_ghost_base.lua +++ b/lua/weapons/weapon_ghost_base.lua @@ -35,6 +35,14 @@ if CLIENT then -- This sets the icon shown for the weapon in the DNA sampler, search window, -- equipment menu (if buyable), etc. SWEP.Icon = "vgui/ttt/icon_nades" -- most generic icon I guess + + net.Receive("SpecDM_BulletGhost", function() + local str = net.ReadString() + local vector = net.ReadVector() + local num = net.ReadUInt(19) + if num == 0 then num = nil end + sound.Play(str, vector, num) + end) -- You can make your own weapon icon using the template in: -- /garrysmod/gamemodes/terrortown/template/ @@ -250,14 +258,6 @@ function SWEP:PrimaryAttack(worldsnd) owner:ViewPunch( Angle( math.Rand(-0.2,-0.1) * self.Primary.Recoil, math.Rand(-0.1,0.1) * self.Primary.Recoil, 0 ) ) end - net.Receive("SpecDM_BulletGhost", function() - local str = net.ReadString() - local vector = net.ReadVector() - local num = net.ReadUInt(19) - if num == 0 then num = nil end - sound.Play(str, vector, num) - end) - function SWEP:DryFire(setnext) if CLIENT and LocalPlayer() == self.Owner then self:EmitSound( "Weapon_Pistol.Empty" )