Drop an alternate weapon on death

I am helping to run a ttt server and would like to get a few custom weapons built to shake up gameplay.

My current idea is to build a powerful weapon that would sometimes spawn on the map or to donators weapon that when dropped by an innocent would remain operational but when dropped by a T would spawn an identical weapon with a jihad bomb/type explosion as its primary fire

I was thinking that the answer would be in using the ondrop function but when I tried to make it spawn another weapon as an entity it didn’t work.

What am I doing wrong? What do I need to add to make it test for traitors?

function SWEP:OnDrop()
local src = ply:GetPos() + (ply:Crouching() and ply:GetViewOffsetDucked() or ply:GetViewOffset())

src = src + (vfw * 1) + (vrt * 3)
local ent = ents.Create(“weapon_ttt_trap”)
ent:SetPos(src)
ent:Spawn()

self:Remove()
end

Use [lua] tags.

You can look in the DARKRP gamemode, they got something like this.