Global/IsValid

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Added note about vehicles)
m (Added source link)
Line 5: Line 5:
 
|Realm=Shared and Menu
 
|Realm=Shared and Menu
 
|IsClass=No
 
|IsClass=No
 +
|File=lua/includes/util.lua
 +
|Line=198
 
}}
 
}}
 
{{Arg
 
{{Arg

Revision as of 17:44, 11 December 2017

 IsValid( )

Description

Returns whether an object is valid or not. (Such as Entitys, Panels, custom table objects and more)
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 Vehicle:IsValidVehicle to make sure the they're fully initialized

Arguments

any toBeValidated

The table or object to be validated.

Returns

boolean

True if the object is valid.
Personal tools
Navigation