Entity.GetKeyValues
From GMod Wiki
Function | |
Syntax | Entity:GetKeyValues( ) |
Description: | |
Creates a table of keyvalue pairs that define this entity | |
Returns: | Table |
In Object: | Entity |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.GetKeyValues]Entity.GetKeyValues [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Retreives the spawnflags of an Entity |
---|---|
Used on | |
Code | function spawnflags ( ent ) return ent:GetKeyValues().spawnflags end |
Output | returns the spawnflags of the Entity ent |
Additional Notes
- Partially broken. It doesn't return all of the keyvalues of an entity properly, and most of the returned values are usually wrong. You can use the "EntityKeyValue" hook instead to get the correct keyvalues: Gamemode.EntityKeyValue.
- This is a direct access to the keyvalues of an Entity
- Dump of keyvalues from a prop (
prop_physics
)
-- number shadowcastdist = 0 -- string ResponseContext = -- number physdamagescale = 0.10000000149012 -- number fademaxdist = 0 -- number fademindist = -1 -- number SetBodyGroup = 0 -- number body = 0 -- string puntsound = -- number hitboxset = 0 -- number speed = 0 -- string overridescript = -- number Damagetype = 0 -- number ExplodeDamage = 0 -- number fadescale = 1 -- number cycle = 0 -- number minhealthdmg = 0 -- number max_health = 0 -- number spawnflags = 0 -- string parentname = -- number sequence = 0 -- number massscale = 0 -- number PerformanceMode = 0 -- number damagetoenablemotion = 0 -- number ltime = 0 -- number gravity = 0 -- number friction = 1 -- number TeamNum = 0 -- string damagefilter = -- string LightingOrigin = -- string target = -- number skin = 0 -- number playbackrate = 0 -- number ExplodeRadius = 0 -- number inertiascale = 0 -- number effects = 0 -- number health = 0 -- number forcetoenablemotion = 0 -- string LightingOriginHack = -- string classname = prop_physics -- string globalname = -- number PressureDelay = 0