Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Looping through a player in search of a Humanoid?

Was wondering how I could search through a player's character/workspace model in search of a Humanoid incase it isn't named "Humanoid", I'm not good with loops but I undestand how to do;

WorkspacePlayer = game.Workspace:FindFirstChild(Player.Name)

--for _, Search (Player.Character)in pairs do?
	if Search:IsA("Humanoid") then

--end

1 answer

✓ Accepted answer

So assuming you already defined player, this will be rather simple. To do this you simply need to use an generic loop. This would be done like so:

player = definition here

for i,v in pairs(player.Character:GetChildren()) do
	if v:IsA("Humanoid") then
		warn("This is an humanoid")
	end
end

This discussion is preserved as it was. New answers, comments, and votes are closed.