I have a script which looks like this:
script.Parent.MouseButton1Click:connect(function()
--code is inserted here
end)
I am wanting to change the script so that, instead of Script.Parent (a TextButton) triggering the code, 'game.Workspace.Screen' (clickDetector) triggers the code. I have:
game.Workspace.Screen.ClickDetector.MouseClick:connect(function()
--same code inserted here
end)
Upon clicking, nothing is happening. As soon as I reverted it to the TextButton script, it worked fine. Any help? No errors are outputted.

1 comment
I didn't use script.parent because 'screen' is not the parent of the script. I can't move the script either because the whole of my code relies on script.parent as it's a GUI. sigh