How to make this?

Hello Developers,

I made a game and it got a problem, its a hospital roleplay game.

So player’s arm or hand can be broken when he falls down or steps on banana peel, how do I make this? like how do i make the player get a arm invisible then a machine or something which makes it visible again

You could set the arm’s transparency to 1, then when they use the machine set it to 0

1 Like

r6 and r15 character have same body part names?

Does your game use R6 or R15? also change the title, it’s misleading unless the player is actually dying.

r15 but in avatar settings of roblox i keep it as r6 so some people may keep r6 or r15 so do both have same part name

Both types have different names. I recommend to check this page.

Then you need to do a check to see if they are R6 or R15, try putting in your script:

if player.Humanoid.RigType == Enum.HumanoidRigType.R6 then
    local r6arm = player:FindFirstChild("Right Arm")
    -- code here
elseif player.Humanoid.RigType == Enum.HumanoidRigType.R15 then
    local r15arm = {
        player:FindFirstChild("RightUpperArm"),
        player:FindFirstChild("RightLowerArm"),
        player:FindFirstChild("RightHand")
    }
     for i,v in pairs(r15arm) do
         -- code here
     end
end

In Game Settings, you can force either R6 or R15 in your game. Then one of these should work for making the arm transparent.

--for R6
player.Character.RightArm.Transparency = 1

--for R15
player.Character.RightUpperArm.Transparency = 1
player.Character.RightLowerArm.Transparency = 1
player.Character.RightHand.Transparency = 1

He said that he wants the player to be able to choose.

Ok… then try this

local humanoid = player.Character.Humanoid

if humanoid.RigType == R6 then

  player.Character.RightArm.Transparency = 1

else

  player.Character.RightUpperArm.Transparency = 1
  player.Character.RightLowerArm.Transparency = 1
  player.Character.RightHand.Transparency = 1

end

That won’t work. You need to use an Enum like this:

if humanoid.RigType == Enum.HumanoidRigType.R6 then

My error… try putting that in the script.

thanks it worked, but why is it soo laggy after keeping this script?