Load custom values from hammer maps?

When you make an entity in hammer, you can add own values to it.
How can i read this values via lua in the game?

Or how could i add a value to a entity in hammer and read it in-game?



That works when you make own SENT, right?

You add the code:
function ENT:KeyValue( key, value )
if ( key == “MyOwnKey” ) then
print(“MyOwnKey have the vale”…value)
To the SENT, and then when the map is loaded it loops through all key values?

I needed it to work with existing entitys as well, is it possible?

Thanks for your answer, i also needed this method for a SENT i made :stuck_out_tongue: