This is what I read, I made it slightly more efficient though, I'm pretty sure this is how people use it? I've never worked with BodyTypes before, I may be completely wrong, so don't judge, either that or the source I read from is horribly wrong.
I'd also like to know if it's necessary to also include Rthro?
local Player = game:GetService("Players").LocalPlayer local Character = workspace:WaitForChild(Player.Name) local Humanoid = Character:FindFirstChild("Humanoid") local BodyParts = {}; for _,Part in ipairs(Character:GetChildren()) do if (Part:IsA("BasePart") and ~= nil) then table.insert(BodyParts, Part) end; end; Player:LoadCharacter() pcall(function() if (Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15) then for i = 1,#BodyParts do BodyParts[i].Locked = true end; end; end) pcall(function() if (Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R6) then for i = 1,#BodyParts do BodyParts[i].Locked = true end; end; end)
Thanks!
If I were you, I would avoid trying to use two if statements for two RigTypes, because you don't really want to be accessing the individual limbs of the character most of the time. Either you'd use HumanoidRootPart, or loop through all of the character's children and check if they're a part.