Probably a simple edit, but, I need some help

Hi.

Our TTT server has had a ton of RDM lately, and I’ve found an RDM Manager on Ulysses. The only issue is that it always shows up when you die, and not when you’re killed by someone on your own team.

This is probably a simple edit, but, I’m not too familiar with Lua on Garry’s Mod, and am just a basic Lua programmer overall.

If someone could edit it to where it is only displayed when you’re killed by someone on your own team, I’d greatly appreciate it.

Here’s the script. Thanks!


util.AddNetworkString("Playerdead")
function playerdead(victim, _, killer)
if not killer:IsPlayer() then return end
net.Start("Playerdead")
net.Send(victim)
    end
hook.Add("PlayerDeath","RDM",playerdead)


util.AddNetworkString("Playerdead")
function playerdead(victim, _, killer)
	if not killer:IsPlayer() then return end
	if killer:Team() == victim:Team() then
		net.Start("Playerdead")
		net.Send(victim)
	end
end
hook.Add("PlayerDeath","RDM",playerdead)

Knew it should’ve been something like that. Thanks a lot for the help!