PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

GetLimb

This function returns the Enum/Limb enum that is associated with the given Part

This function works for both R15 and R6 rigs, for example:

-- For R15
print(humanoid:GetLimb(character.LeftUpperLeg)) -- Enum.Limb.LeftLeg
print(humanoid:GetLimb(character.LeftLowerLeg)) -- Enum.Limb.LeftLeg
print(humanoid:GetLimb(character.LeftFoot)) -- Enum.Limb.LeftLeg

-- For R6
print(humanoid:GetLimb(character:FindFirstChild("Left Leg"))) -- Enum.Limb.LeftLeg

GetLimb will throw an error if the Part|Part's parent is not set to the Humanoid|Humanoid's parent.

Parameters

Name Type Default Description

The Part for which the Enum/Limb enum is to be retrieved.

Returns

Return Type Summary

The Enum/Limb the part corresponds with.


Code Samples


Humanoid:GetLimb

Put this in a LocalScript. The output will vary based on if the humanoid is R6 or R15.

local character = game.Players.LocalPlayer.Character
local humanoid = character.Humanoid
for _, child in pairs(character:GetChildren()) do
	local limb = humanoid:GetLimb(child)
	if limb ~= Enum.Limb.Unknown then
		print(child.Name .. " is part of limb " .. limb.Name)
	end
end