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

How to make HumanoidRootPart invisible?

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?

1 comment

0

You don't have to loop anything... Please give us the script...

3 answers

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

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)

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

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