Methods
:GetChildren()
Returns a table containing all of the direct children of the Instance.
for _, child in ipairs(game.Workspace:GetChildren()) do
print(child.Name)
end
:IsA(string: className)
checks if the instance is of the same Class as the className
:GetDescendants()
Returns a table containing all objects parented to the Instance at any depth (children, children's children, etc.).
for _, descendant in ipairs(game.Workspace:GetDescendants()) do
if descendant.ClassName == "Humanoid" then
print("Found a humanoid:", descendant.Parent.Name)
end
end
:FindFirstChild(string: name)
Searches for a direct child with the given name. This is faster than iterating through :GetChildren().
local camera = game.Workspace:FindFirstChild("Camera")
if camera then
-- do something
end
:FindFirstChildOfClass(string: className)
Searches for a direct child with the given ClassName.
local humanoid = game.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
:SetHighlightOnTop()
Makes the Highlight Instance render on top of walls.
:SetHighlightTransparency(float: transparency)
Sets the transparency of the highlight effect.
Last updated