IsDescendantOf

IsDescendantOf is a member function of Instance used to determine whether or not the provided object is a parent or distant parent of the calling object.

function object:IsDescendantOf(item) local test = self while test ~= item do test = test.Parent if item ~= game and test == game then return false end end return true end