/drop command?

I’m currently working on a /drop command for my server.
I don’t like how the default player:DropWeapon() works, so that’s why.

How would I go about doing this? Here’s what I think

Is this a good way to do it, or am I overthinking this?

EDIT:
Also, if this is the right way, how would I get the vector on the ground 1ish meters in front of the player, taking which way they’re looking into account?

How about using that.

[lua]
hook.Add(“PlayerSay”, “DropWeaponAMK”, function(ply, text, public)
if (string.lower(text) == “/getaway”) then
if IsValid(ply:GetActiveWeapon()) then
local shit = {}
shit.start = ply:GetShootPos()
shit.endpos = ply:GetShootPos() + (ply:GetAimVector() * 90)
shit.filter = ply
shit.mins = Vector(-15, -5, 0)
shit.maxs = Vector(15, 5, 5)
local shittrace = util.TraceHull(shit)
local shitent = ents.Create(“prop_physics”)
if shittrace.Hit then
shitent:SetPos(shittrace.HitPos)
else
shitent:SetPos(shit.endpos)
end
if !shitent:IsInWorld() then shitent:SetPos(ply:GetPos()) end
shitent:SetAngles(ply:GetAngles())
shitent:SetModel(ply:GetActiveWeapon().WorldModel)
shitent.Classy1abitch = ply:GetActiveWeapon().ClassName
shitent:Spawn()
ply:StripWeapon(ply:GetActiveWeapon().ClassName)
end
return “”
end
end)

hook.Add(“PlayerUse”, “TakeWeaponAMK”, function(ply, ent)
if ent.Classy1abitch and !ent.nextUsage then
if !ply.nextSexyWeapon or ply.nextSexyWeapon < CurTime() then
ent.nextUsage = true
ply.nextSexyWeapon = CurTime() + 0.5
ply:Give(ent.Classy1abitch)
ent:Remove()
end
end
end)
[/lua]