Trying to check if body parts are in a table

im just trying to get the body parts from my table but im not sure how to. ty!

this is what i got:

	local bodyParts = {
		"LeftUpperArm",
		"LeftLowerArm",
		"LeftHand",
		"RightUpperArm",
		"RightLowerArm",
		"RightHand"
	}


	for i, bodyPart in char:GetChildren() do
		if bodyPart.Name == bodyParts then
			rs.RenderStepped:Connect(function()
				
			end)
		end	
	end

Are you trying to check if it’s in the table?

If you are, try:

local bodyParts = {
	"LeftUpperArm",
	"LeftLowerArm",
	"LeftHand",
	"RightUpperArm",
	"RightLowerArm",
	"RightHand"
}

rs.RenderStepped:Connect(function()
	for i, bodyPart in ipairs(char:GetChildren()) do
		if table.find(bodyParts, bodyPart.Name) then
			--do stuff
		end
	end
end)
1 Like

yes! that is exactly what i wanted, i just forgot how to do it. THANK U SO MUCH, have a great day! :smiley:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.