How can I drop weapons?

When im downloaded a wep_drop thingy its stod on the info that i should write bind g dropweapon in console and than when i press g this comes up in the console
Unknown command: dropweapon
What shall i do to drop weapons please tell me

[lua]
function dropMyWeapon(ply,command,args)
ply:DropWeapon(ply:GetActiveWeapon())
end
concommand.Add(“dropmyweapon”,dropMyWeapon)
[/lua]


(User was banned for this post ("Help properly or don't post" - UberMensch))

Put this into a file called dropweapon.lua and move the file to garrysmod/lua/autorun/client.

It might need few changes if it doesn’t work clientside.

actually its serverside sadly, so garrysmod/lua/autorun/server

Why did you ban him for it…

For the reason I stated. Someone’s asking for help and posting a Lua snippet which might not even work isn’t helping the OP.

Shall i copy all or just a little bit of it??

Download it
All your problems were solved