TextLabel invisible even when the visibility is on an transparency is 0

I am trying to make an error text label and when I turn visible on in studio it shows but when its off and I play the game with the script that makes it visible it doesn’t show, the script works but for some reason its invisible. Thank you for your time!

local starterGUI = game:GetService("StarterGui")
local items = serverStorage.Items
local Axe = items.Axe
local Pickaxe = items.Pickaxe
local errorText = game.StarterGui.Shop.TextLabel
	
	if Gold.Value >= 5 then
		errorText.TextTransparency = 1
	else
		errorText.TextTransparency = 0
	end
end)

that is the general area and I deleted some un important stuff.

5 Likes

Kk! Quick question do you want me to help you?

If so what type of script is it?

yes please!!!

Like Local Script, Server Script, Module Script.

regular server script______________

Alrighty, then give me a few minutes to look at the script.

Question is it visible? or is it not visible?

Is the TextLabel actually visible? Try checking if TextLabel.Visible is false.

Because it’s putting the TextTransparency to 1. Not the visibility to true.

I also made a remote event and i have a seperate local script in the shop button that just fires the server once the button is clicked

This won’t work at all! Your using StarterGUI and you need to use PlayerGUI. StarterGUI is duped into PlayerGUI for players to see them.

its visible ive tried both ways with text transparency and visible and none worked

oh shoot lollllllllllllllllllllllll

Try this based on what @OfficialPogCat said:

local Player = game:GetService("Players").LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui") :: StarterGui
local items = serverStorage.Items
local Axe = items.Axe
local Pickaxe = items.Pickaxe
local errorText = PlayerGui:WaitForChild("Shop").TextLabel

if Gold.Value >= 5 then
	errorText.TextTransparency = 1
else
	errorText.TextTransparency = 0
end
end)

local starterGUI = game:GetService(“StarterGui”)
local items = serverStorage.Items
local Axe = items.Axe
local Pickaxe = items.Pickaxe

game.Players.PlayerAdded:Connect(function(player)
local errorText = player.PlayerGui.Shop.TextLabel
if Gold.Value >= 5 then
errorText.TextTransparency = 1
errorText.Visible = false
else
errorText.TextTransparency = 0
errorText.Visible = true
end
end)
end)

Here you go that’s your script.

Btw you don’t need the starterGUI Variable at the first line.

let me just give you the half script to make it easier to understand

You don’t need the first variable for StarterGui.You’ll also have to format the indents within it.