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?
[QUOTE=Feihc;27010741][lua]
concommand.Add("!givegravgun", function(ply, cmd, args) if ValidEntity(ply) then ply:Give("weapon_physcannon") end end)[/lua][/QUOTE]
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 [b][u]Wizard of Ass[/u][/b] can correct me if I am wrong.
and what should i do with this godlike?
[QUOTE=Godlike2;27011677][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 [b][u]Wizard of Ass[/u][/b] can correct me if I am wrong.[/QUOTE]
physcannon, not phycannon
[QUOTE=mahalis;27013037]physcannon, not phycannon[/QUOTE]
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.
Sorry, you need to Log In to post a reply to this thread.