Ok, so, I'm trying to make a chat button on the topbar but the visible code won't work, I need help
local ChatButton = script.Parent.Bar:WaitForChild("Chat")
local ChatTarget = script.Parent.Parent.Parent.Chat.Frame
ChatButton.MouseButton1Click:connect(function()
if ChatTarget.Visible then
ChatTarget.Visible=false
else
ChatTarget.Visible=true
end
end)

3 comments
Are you getting any errors in the output box? If you are, could you type them here? Also, instead of using "connect" in line 4, use "Connect" instead. "connect" is deprecated and ROBLOX might delete it soon, so make sure you capitalize the "c".
Also, what's the point of the "if" statement on line 5? What is this checking for exactly? Is it checking for "Visible" as in the property? Because I am unsure if you can use an "if" statement to check if a property exists. If this is what you are trying to use it for, I don't think there is a reason for it anyway. Did you maybe mean to type "if ChatTarget.Visible == true then"?
I have a similar code in GUI but FE broke it