Garry's Mod Wiki

Revision Difference

Global.IsValid#518393

<function name="IsValid" parent="Global" type="libraryfunc"> <description> Returns whether an object is valid or not. (Such as <page>Entity</page>s, <page>Panel</page>s, custom <page>table</page> objects and more)&amp;lt;br /&amp;gt;Checks that an object is not nil, has an IsValid method and if this method returns true. Returns whether an object is valid or not. (Such as <page>Entity</page>s, <page>Panel</page>s, custom <page>table</page> objects and more)&lt;br /&gt;Checks that an object is not nil, has an IsValid method and if this method returns true. <note>Due to vehicles being technically valid the moment they're spawned, also use <page>Vehicle:IsValidVehicle</page> to make sure they're fully initialized</note> </description> <realm>Shared and Menu</realm> <file line="200-L209">lua/includes/util.lua</file> <args> <arg name="toBeValidated" type="any">The table or object to be validated.</arg> </args> <rets> <ret name="" type="boolean">True if the object is valid.</ret> </rets> </function>