So I have this broken script I've been trying to fix for months unsuccessfully. I've been troubleshooting and trying to figure out what the problem code is so that I can fix it, and I've narrowed it down to an error I get in the developer console in play mode. This script works perfectly in studio test mode but not in play mode. In Play mode I get an error that says "FRAME is not a valid member of ScreenGui." as if FRAME (which is just a gui frame) isn't in the spot I'm saying it is which can't be true because it works in test mode. Any ideas of what could be causing this? thanks guys!
local BUTTON = script.Parent
local TOOLS = BUTTON.Parent.Parent.FRAME
function onMouseButton1Down(mouse)
TOOLS.Visible = (not TOOLS.Visible)
end
BUTTON.MouseButton1Down:connect(onMouseButton1Down)

2 comments
Thank you SOOOOOO much this is probably what was wrong with all my other scripts too. THANK YOU!
No problem :3