local player = game.Players.LocalPlayer local txt = script.Parent.TextLabel local Frame = script.Parent.Parent script.Parent.MouseButton1Click:connect(function() if txt.Visible == true then txt.Visible = false else if txt.Visible == false then txt.Visible = true end end end)
Textlabel is inside ImageButton, but its not a valid member of it? WHAT?
If this helps, please be sure to accept my answer.
local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() -- we add this to wait for the player's character to be added in workspace. local txt = script.Parent:WaitForChild('TextLabel') -- Use WaitForChild so it can wai for the child to be added. local Frame = script.Parent.Parent script.Parent.MouseButton1Click:connect(function() if txt.Visible == true then txt.Visible = false elseif txt.Visible == false then -- DON'T leave a space between "else" and "if". txt.Visible = true end --you had an extra "end" here. I remved it though. We don't need one here because you are not ending a scope. end)