local frame = script.Parent.Parent.frame script.Parent.MouseButton1Click:Connect(function() if frame.Visible == false then frame.Visible = true else frame.Visible = false end end)
Just take out "frame", there is nothing named "frame" under "frame"
local frame = script.Parent.Parent --this is already the frame itself script.Parent.MouseButton1Click:Connect(function() if frame.Visible == false then frame.Visible = true else frame.Visible = false end end)