Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

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

Asked by 4 years ago

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

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago
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.

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! incapaz 195 — 4y
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. TheLuminent 1204 — 4y
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. TheLuminent 1204 — 4y
Ad
Log in to vote
1
Answered by
Dexiber 272 Moderation Voter
4 years ago

Try this:

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

Enums should work better.

Log in to vote
0
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 years ago
if game.Players.LocalPlayer.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
print("Player is an R6")
end

Answer this question