Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can someone help me fix my text Button Script the commented code is not working?

So to expand on my issue I made a script that makes all text buttons visible property to false except for the one that is being clicked. The one that is clicked changes and all but if I click another one I noticed that a portion of the code did not make the other labels visible property to false

local clickEffect = script.Parent:FindFirstChild(script.Parent.Name .. 2)
local Underline = clickEffect:FindFirstChild("UnderLine")
local Lables = game.StarterGui.MainMenu.NavBar.Lables:GetChildren() 
script.Parent.MouseButton1Click:Connect(function()
	--[[for x = 1,#Lables,1 do
 		Lables[x]:FindFirstChild(Lables[x].Name .. 2).Visible = false
	end
--]]
	clickEffect.Visible = true
end)

Thanks

1 comment

0

Hey bro.. Can you make a actually question of what you asked in the chat? I have a answer

1 answer

✓ Accepted answer

So if I understand correctly, you want to make all the guis invisible except for the one you clicked on?

Well here it is

local clickEffect = script.Parent[script.Parent.Name..2] --waduoflip?
local Underline = clickEffect.UnderLine
local Lables = game.Players.LocalPlayer.PlayerGui.MainMenu.NavBar.Lables:GetChildren() 
script.Parent.MouseButton1Click:Connect(function()
    for x = 1, #Lables do
        if Lables[x] ~= script.Parent then
            Lables[x][Lables[x].Name..2].Visible = false --Weird things going on in your code
        end
    end
    clickEffect.Visible = true
end)

1 comment

0

yup

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