Garry's Mod Wiki

Entity:SetSaveValue

boolean Entity:SetSaveValue( string name, any value )

Description

Sets a save value for an entity. You can see a full list of an entity's save values by creating it and printing Entity:GetSaveTable().

See Entity:GetInternalVariable for the opposite of this function.

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

1 string name
Name of the save value to set
2 any value
Value to set

Returns

1 boolean
Key successfully set

Example

Make all rollermines currently on the map friendly

for i, mine in ipairs( ents.FindByClass( "npc_rollermine" ) ) do mine:SetSaveValue( "m_bHackedByAlyx", true ) end

Page Links


Special Pages


Wikis

?

Render Time: 37ms

DB GetPage 3
Generate Html 11
SaveChanges (1) 8
Render Body 0
Render Sidebar 13