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

How would I make it to where I could know what a Player's RigType is?

I've tried this:

if game.Players.LocalPlayer.Character.Humanoid.RigType == "R6" then
print("Player is an R6")
end

But it just doesn't work.... I tested it on myself and I am indeed R6.

3 answers

✓ Accepted answer
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()

repeat
	wait()
until Character:FindFirstChildOfClass("Humanoid")

local Humanoid = Character:FindFirstChildOfClass("Humanoid")

if Humanoid.RigType.Value == 0 then
	-- Humanoid RigType is R6
elseif Humanoid.RigType.Value == 1 then
	-- Humanoid RigType is R15
end

This is probably the best way.

3 comments

0

-1 for reinventing the wheel for no reason and for unnecessarily comparing the Value of the RigType. Just check the enum! It is more explicit that way!

0

I have tried with the EnumItem but for some reason it runs into an error on my side, so I made the edit to this comment. I do understand though. Thank you for replying.

0

Another thing to state is that it is a lot faster to type and some people depend on the time of that to get their work done. Some things just have to be done a different way.

Try this:

if game.Players.LocalPlayer.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
print("Player is an R6")
end

Enums should work better.

if game.Players.LocalPlayer.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
print("Player is an R6")
end

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