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

Making Text Label Invisible Not Working?

Asked by
TechModel 118
3 years ago
Edited 3 years 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 345 — 3y
0
And if you write the code in a LocalScript, it will only run on the client, and other playyers wont see it WoTrox 345 — 3y

1 answer

Log in to vote
1
Answered by
WoTrox 345 Moderation Voter
3 years 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