Ad
Log in to vote
0

Making Text Label Invisible Not Working?

Asked by 10 months ago
Edited 10 months ago

I try to remove a text label specifically only for me but no anyone else.

game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
        local GuiClone = script.OverheadGui:Clone()
        GuiClone.Parent = Character.Head

        local UpperText = GuiClone.UpperText
        local MiddleText = GuiClone.MiddleText
        local LowerText = GuiClone.LowerText
        local Background = GuiClone.Background

        if Player.Name == "TechModel" then
            MiddleText.Visible = false
        end
    end)
end)

And the text label does not disappear and I'm not sure why. I want my MiddleText to not show up for my Gui above my head.' Thank you.

0
There's a Visible property, so you can just set the TextLabel.Visible to true or false WoTrox 315 — 10mo
0
And if you write the code in a LocalScript, it will only run on the client, and other playyers wont see it WoTrox 315 — 10mo

1 answer

Log in to vote
1
Answered by
WoTrox 315 Moderation Voter
10 months ago
game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
        if Player.Name == "TechModel" then
            local GuiClone = script.OverheadGui:Clone()
            GuiClone.Parent = Character.Head
        end
    end)
end)

This code only puts the Gui in the player's character if it's you, no need to make it invisible (make sure it's in a server script)

Let me know if I helped

Ad

Answer this question