Entity/SetSaveValue

From Garry's Mod
Revision as of 23:30, 17 November 2019 by Code gs (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 Entity:SetSaveValue( )

Contents

Description

Sets a save value for an entity.

BUG

This does not type-check entity keys. Setting an entity key to a non-entity value will treat it as NULL.

Issue Tracker: #4065

Arguments

string name

Name of the save value to set

Arguments

any value

Value to set

Returns

boolean

Key successfully set

Examples

Example

Make all rollermines currently on the map friendly

for k, v in pairs( ents.FindByClass( "npc_rollermine" ) ) do
    v:SetSaveValue( "m_bHackedByAlyx", true )
end


Personal tools
Navigation