Entity/SetSaveValue

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Added return)
(Bug)
 
Line 1: Line 1:
 
{{Func
 
{{Func
 
|Description=Sets a save value for an entity.
 
|Description=Sets a save value for an entity.
 +
 +
{{Bug|Issue=4065|This does not type-check entity keys. Setting an entity key to a non-entity value will treat it as NULL.}}
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=Yes
 
|IsClass=Yes

Latest revision as of 23:30, 17 November 2019

 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