Gui Not Disappearing When Tool Unequips?

What Do I Want To Achieve: The Gui To Disappear
What Have I Tried: Using Wait(), WaitForChild

local player = Players.LocalPlayer 
local Players = game:GetService('Players')
local tool = script.Parent 
local value = tool:WaitForChild('Value')

local playerGui = player.PlayerGui 

local gui = playerGui:WaitForChild('Ammo') 
local text = gui:WaitForChild('TextLabel') 



    script.Parent.Unequipped:Connect(function()

    	text.TextTransparency = 1
    end)
    script.Parent.Equipped:Connect(function()

    	text.TextTransparency = 0
    	end)

Currently no error messages coming up.
also btw i have another script counting and adding more value to the gui each time i click

ik players goes in front of players btw

1 Like

TextTransparency only makes the text invis, not the gui itself. If you want to make the entire gui invis change TextTransparency to just Transparency

still does not work? (charsssss)

1 Like

Try to use text.Active = true/false

Why not instead of all of those use Frame.Visible and set it to false? it will make the frame not visible anymore.

2 Likes

i found a solution by setting the gui value to a empty number value