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

How to make HumanoidRootPart invisible?

Asked by
xp3000 0
10 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

When players turn invisible and then visible again, the blue brick of the HumanoidRootPart is visible and obscures the character models of the game. How can I loop it so it stays invisible?

0
You don't have to loop anything... Please give us the script... Freemium 110 — 10y

3 answers

Log in to vote
0
Answered by 10 years ago
c=script.Parent:children()
for i=1,#c do
if c[i].className=="Part"then
c[i].Transparency=0
if c[i].Name=="HumanoidRootPart"then
c[i].Transparency=1
end end end
Ad
Log in to vote
0
Answered by 10 years ago

Try using the Changed event to detect changes, something like this should suffice:

function Fix(Char)
    Char.HumanoidRootPart.Changed:connect(function(p)
        if string.lower(tostring(p)) == "transparency" then
            pcall(function() Char.HumanoidRootPart.Transparency = 1 end)
        end
    end)
end

game:GetService("Players").PlayerAdded:connect(function(Plr)
    repeat wait(1/30) until Plr.Character ~= nil and Plr.Character.Parent == Workspace and Plr.Character:findFirstChild("HumanoidRootPart")
    Fix(Plr.Character)
    Plr.CharacterAdded:connect(Fix)
end)
Log in to vote
0
Answered by
Rawblocky 217 Moderation Voter
8 years ago

Basically, follow these steps:

Step 1: Make a script

Step 2: Put it in StarterGui

Step 3: Put this code in this script:

while true do
repeat wait() until script.Parent.Parent.Character ~= nil
script.Parent.Parent.Character.HumanoidRootPart.Transparency = 1
end

Answer this question