How do I detect if a player's humanoid is RigType R6 or R15?

I have my code here but I can’t figure out why it doesn’t work, please help me. Thanks!

 if Player.Character.Humanoid.RigType == "R15" then
  			local Weld = Instance.new('WeldConstraint')
  			Weld.Name = 'Weld'
  			Weld.Part0 = Player.Character.RightHand
  			Weld.Part1 = OtherPlayer.Character.HumanoidRootPart
              Weld.Parent = Player.Character.RightHand
          end```
1 Like

you can check if the dummy has a “Torso (R6)” or “UpperTorso (R15)”

if Player.Character:FindFirstChild("Torso") then

   return "R6"

end
2 Likes

R15 = UpperTorso
R6 = Torso

2 Likes

Oh alright! I’ll revise that really quick.

That’s all you need

if Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
if Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
10 Likes

And now the code gives errors on random lines.

            if Officer.Character:FindFirstChild("Torso") then
        			local Weld = Instance.new('WeldConstraint')
        			Weld.Name = 'Weld'
        			Weld.Part0 = Player.Character.RightHand
        			Weld.Part1 = OtherPlayer.Character.HumanoidRootPart
                    Weld.Parent = Player.Character.RightHand
                end
            
            elseif Player.Character:FindFirstChild("UpperTorso") then
                local Weld = Instance.new('WeldConstraint')
                Weld.Name = 'Weld'
                Weld.Part0 = Player.Character.RightArm
                Weld.Part1 = OtherPlayer.Character.HumanoidRootPart
                Weld.Parent = Player.Character.RightArm
            end```
if Officer.Character:FindFirstChild("Torso") then
        			local Weld = Instance.new('WeldConstraint')
        			Weld.Name = 'CriminalWeld'
        			Weld.Part0 = Officer.Character.RightHand
        			Weld.Part1 = Victim.Character.HumanoidRootPart
                    Weld.Parent = Officer.Character.RightHand
            
            elseif Officer.Character:FindFirstChild("UpperTorso") then
                local Weld = Instance.new('WeldConstraint')
                Weld.Name = 'CriminalWeld'
                Weld.Part0 = Officer.Character.RightArm
                Weld.Part1 = Victim.Character.HumanoidRootPart
                Weld.Parent = Officer.Character.RightArm
                end
            end

Oh ok, that should fix it now I think.

Nope this code still gives me errors at the start for some reason.

Go try this:

if Player.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
  			local Weld = Instance.new('WeldConstraint')
  			Weld.Name = 'Weld'
  			Weld.Part0 = Player.Character.RightHand
  			Weld.Part1 = OtherPlayer.Character.HumanoidRootPart
            Weld.Parent = Player.Character.RightHand
 end
1 Like

Alright, I can try to do this.

Literally copying my solution but it’s okay x)

What? i don’t copy but that’s how I do it, maybe your way and mine are the same

Alr so I have done this, but now something with my collision service went wrong somehow. My whole code is:

-- Arrest System

-- Services
local PlayerService = game:GetService('Players')
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local TeamService = game:GetService('Teams')
local PhysicService = game:GetService('PhysicsService') --Error here

-- Refrences
local Remotes = ReplicatedStorage.Remotes
local CuffRemote = Remotes.CuffEvent
local PlayerGroup = PhysicService:CreateCollisionGroup('PlayerGroup')
local PartGroup = PhysicService:CreateCollisionGroup('PartGroup')

PhysicService:CollisionGroupSetCollidable('PartGroup', 'PlayerGroup', false)

-- functions

local function OnCuff(Officer, Victim)
	-- Make sure they 'exist' and haven't left the game yet.
	if Officer and Victim then
		-- Make sure neither of them are dead.
		if Officer.Character.Humanoid.Health > 0 and Victim.Character.Humanoid.Health > 0 then
			-- Make sure that the player hasn't been cuffed by another officer
			if Victim:FindFirstChild('Cuffed') then
				return warn('Player cuffed by another officer')
			end

			if (Victim.Character.Head.Position - Officer.Character.Head.Position).Magnitude > 15 then
				return warn('Too far away!')
			end

			-- Prevent any other officers cuffing the victim
			local CuffedValue = Instance.new('IntValue')
			CuffedValue.Name = 'Cuffed'
			CuffedValue.Value = 1
			CuffedValue.Parent = Victim

			-- Play cuffed animation
			local CurrentAnimations = Victim.Character.Humanoid:GetPlayingAnimationTracks()
			-- stop any current animations (such as walking)
			for i, track in pairs (CurrentAnimations) do
				track:Stop()
			end

			Victim.Character.Humanoid.WalkSpeed = 0
			Victim.Character.Humanoid.JumpPower = 0
            Victim.Character.Humanoid.PlatformStand = true
            Victim.Backpack.Handcuffs.Parent = game.ServerStorage
            Victim.Backpack.ArrestCuffs.Parent = game.ServerStorage
			
			local CuffAnimation = Instance.new('Animation')
			CuffAnimation.AnimationId = 'rbxassetid://8722758589'
			CuffAnimation.Parent = Victim.Character

			local OfficerAnimation = Instance.new('Animation')
			OfficerAnimation.AnimationId = 'rbxassetid://8722767340'
			OfficerAnimation.Parent = Officer.Character

			local LoadedOfficer = Officer.Character.Humanoid:LoadAnimation(OfficerAnimation)
			LoadedOfficer:Play()
            
            local LoadedCuff = Victim.Character.Humanoid:LoadAnimation(CuffAnimation)
            LoadedCuff:Play()
            
			-- Weld the criminal to the Officer's hand so they can't move

			for _, Part in ipairs(Victim.Character:GetDescendants()) do
				if Part:IsA('BasePart') then
					Part.Massless = true
				end
            end
            
            if Officer.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
                local Weld = Instance.new('WeldConstraint')
                Weld.Name = 'CriminalWeld'
                Weld.Part0 = Officer.Character.RightHand
                Weld.Part1 = Victim.Character.HumanoidRootPart
                Weld.Parent = Officer.Character.RightHand
            end

            if Officer.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
                local Weld = Instance.new('WeldConstraint')
                Weld.Name = 'CriminalWeld'
                Weld.Part0 = Officer.Character.RightArm
                Weld.Part1 = Victim.Character.HumanoidRootPart
                Weld.Parent = Officer.Character.RightArm
            end

			Victim.Character.HumanoidRootPart.CFrame = Officer.Character:WaitForChild("HumanoidRootPart").CFrame * CFrame.new(0,.6,-2.5)
            
            Remotes.ReleaseEvent.OnServerEvent:Connect(function()
                Officer.Character.RightHand:FindFirstChild("CriminalWeld"):Destroy()
                Victim.Character.Humanoid.PlatformStand = false
                Victim.Character.Humanoid.WalkSpeed = 16
                Victim.Character.Humanoid.JumpPower = 50
                LoadedCuff:Stop()
                Victim:FindFirstChild('Cuffed'):Destroy()
                game.ServerStorage.ArrestCuffs.Parent = Victim.Backpack
                game.ServerStorage.Handcuffs.Parent = Victim.Backpack
            end)
		end
    end
end

CuffRemote.OnServerEvent:Connect(OnCuff)```

I have kind of forgotten about this post, but I’ll give the solution to @Crygen54 as he said what you said first.

1 Like