Facepunch / garrysmod-requests

Feature requests for Garry's Mod
83 stars 24 forks source link

ENTITY:GetKeyValue(string key) function #391

Open TFlippy opened 9 years ago

TFlippy commented 9 years ago

Currently, using the ENTITY:KeyValue hook that returns a table is fairly difficult, so having a simplier function that returns the specified keyvalue's value would have been handy.

Let's say, you have prop_physics entity with a custom keyvalue called "price", which is 500. Using print(ent:GetKeyValue("price")) would result in "500" being printed in chat.

disseminate commented 9 years ago

For anyone wondering, Entity:GetKeyValues is broken.