ENT.KeyValue

From GMod Wiki

Revision as of 23:20, 1 October 2009 by Unrealomega (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameKeyValue
SyntaxENT:KeyValue( String key, String value )
DescriptionCalled when the entity key values are setup (either through calls to ent:SetKeyValue, or when the map is loaded).
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=ENT.KeyValue]ENT.KeyValue [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionStraight from the gmdm_pickup, Sets the pickup type when you set the "item" keyvalue.
Used onNewerServer.png
Code
function ENT:KeyValue( key, value )
	if ( key == "item" ) then
		self:SetPickupType( value )
	end
end
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox