Garry's Mod Wiki

Garry's Mod Wiki

  GM:VariableEdited( Entity ent, Player ply, string key, string val, table editor )


Called when a variable is edited on an Entity (called by Edit Properties... menu). See Editable Entities for more information.


1 Entity ent
The entity being edited
2 Player ply
The player doing the editing
3 string key
The name of the variable
4 string val
The new value, as a string which will later be converted to its appropriate type
5 table editor
The edit table defined in Entity:NetworkVar


From base/gamemode/variable_edit.lua

function GM:VariableEdited( ent, ply, key, val, editor ) if ( !IsValid( ent ) ) then return end if ( !IsValid( ply ) ) then return end local CanEdit = hook.Run( "CanEditVariable", ent, ply, key, val, editor ) if ( !CanEdit ) then return end ent:EditValue( key, val ) end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...