This article's documentation is for anything that uses the Source engine. Click here for more information.

Give: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎See also: clean up, replaced: See Also → See also)
(not sure about this tip)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Console command}}
{{This is a|console command|name=give}}
'''<code>give</code>''' is a console command that gives the player (or, rather, spawns beneath their feet) any specified entity.
'''<code>give</code>''' is a console command that gives the player (or, rather, spawns beneath their feet) any specified entity.


Line 5: Line 5:


{{note|Some entities will not work properly with this command because they need to be set up through Hammer.}}
{{note|Some entities will not work properly with this command because they need to be set up through Hammer.}}
{{tip|Using a {{ent|point_servercommand}} entity to <code>give</code> the player something, is usually more reliable than the <code>[[point_template]] ForceSpawn</code> seen in the [[Newgame_spawn]] [[prefab]], because the <code>give</code> command is not bound to a physical place, whereas the <code>point_template</code> will dump entities at the original spawnpoint when {{ent|buildcubemaps}} is fired.{{confirm|This just sounds a little weird?}}}}


==Syntax==
==Syntax==

Latest revision as of 04:05, 5 April 2025

give is a console command available in all Source Source games. give is a console command that gives the player (or, rather, spawns beneath their feet) any specified entity.

This command requires sv_cheats 1 in multiplayer games like Team Fortress 2, but not singleplayer games. Valve did not mark this as a cheat in Portal 2, and it allows for some very clever uses in challenge mode.

Note.pngNote:Some entities will not work properly with this command because they need to be set up through Hammer.

Syntax

give ENTITY

In Half-Life 2, give weapon_rpg will spawn a rocket launcher under the player (which they will usually immediately pick up).

See also