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 someone's health gui invisible?

I would like to have use a script making the nametags/health on all the people on the blue team not visible. Here is the script I used.

for i,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == BrickColor.new("Bright blue") then  
        v.HealthDisplayDistance = 0
            v.NameDisplayDistance = 0
    end
end

Thanks

1 answer

That will make all the blue team's health and name invisible, but it will only run once. If a new player joins the blue team, the code will not run again.

I would recommend a LocalScript in StarterGui, that way whenever a player respawns the code will run.

local plr = game.Player.LocalPlayer
plr.CharacterAdded:wait()
chr = plr.Character

if plr.TeamColor == BrickColor.new("Bright blue") then
	chr.HealthDisplayDistance = 0
	chr.NameDisplayDistance = 0
end

2 comments

0

Oh that was actually on accident when I copied it. Thats not the problem

0

Read it now

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