IsValid||doc136405

September 20, 2022

Format

Instance:IsValid()

Describe

Gets whether the instance object reference is valid. This function returns false when the instance object is destroyed.

Return value

Type Describe
bool Is it valid

Code example

local part = Instance.new("Part")
print(part:IsValid()) -- true
part:Destroy()
print(part:IsValid()) -- false