Posted
How do I access everyones humanoid if they are set in the workspace. Found a way to make a kill all, I only need to this.
Replied
Well, it's simple, just loop through the workspace's children and check if they contain a humanoid.
Here is the script:
[code]
-- GetChildren() returns a list of workspace's members (or children)
for index, child in next, workspace:GetChildren() do
-- Safely checks if the child has a Humanoid object within it.
local Humanoid = child:FindFirstChildOfClass("Humanoid")
-- If the Humanoid exists then, it's gonna print the child's name.
if Humanoid then
print(child.Name, "has a humanoid.")
end
end
[/code]
Cancel
Post
Proud creator of: WRD+
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post