Give: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(adding ent_create at the bottom)
mNo edit summary
Line 1: Line 1:
'''<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.


This command requires <code>[[sv_cheats]] 1</code> in some games. Valve did not mark this as a cheat in Portal 2, and it allows for some very clever uses in challenge mode.
This command requires <code>[[sv_cheats]] 1</code> 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|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.}}

Revision as of 14:24, 14 February 2023

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.
Tip.pngTip:Using a point_servercommand entity to give the player something, is usually more reliable than the point_template ForceSpawn seen in the Newgame_spawn prefab, because the give command is not bound to a physical place, whereas the point_template will dump entities at the original spawnpoint when buildcubemaps is fired.
Confirm:This just sounds a little weird?

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