Gravgun addon?

I need a quick addon that a player could type in !gravgun or something like that and it will spawn you a gravity gun.
thanks in advance, i would really appreciate it!
thanks, cabbie.

[lua]
concommand.Add("!givegravgun", function(ply, cmd, args) if ValidEntity(ply) then ply:Give(“weapon_physcannon”) end end)[/lua]

for my gamemode, which lua file should i put this in?

That’s a console command, that wouldn’t do so well.

[lua]function ISaid( ply, text, team )
if (string.sub(text, 1, 11) == “!gravitygun”) then
ply:Give(“weapon_phycannon”)
end
end
hook.Add( “PlayerSay”, “ISaid”, ISaid )[/lua]

Something like that, I may not be correct. Maybe Wizard of Ass can correct me if I am wrong.

and what should i do with this godlike?

physcannon, not phycannon

Fuck got ninja’d :v:

Also, why would you substring that, its quite pointless…

And localize the function or put it directly in the hook, you dumbfuck.