Garry's Mod Wiki

Revision Difference

GM:OnUndo#517771

<function name="OnUndo" parent="GM" type="hook"> <ishook>yes</ishook> <description>Called when the player undoes something.</description> <realm>Client</realm> <predicted>No</predicted> <args> <arg name="name" type="string">The name of the undo action</arg> <arg name="customText" type="string">The custom text for the undo, set by &lt;page&gt;undo.SetCustomUndoText&lt;/page&gt;</arg>⤶ <arg name="customText" type="string">The custom text for the undo, set by <page>undo.SetCustomUndoText</page></arg>⤶ </args> </function> <example> <description>Print a message when the player undoes something.</description> <code> function GM:OnUndo( name, customText ) if customText != nil then MsgN( "Undone " .. customText ) else MsgN( "Undone " .. name ) end end </code> <output>Undone &amp;lt;action&amp;gt;</output> <output>Undone &lt;action&gt;</output> </example>