Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Script that I believe should work doesn't!?

Hello!

I've been developing a game that needs GUIs, but I've run into a problem. I've typed up this script- it doesn't pop up with errors, but when I try to run the event (click event) the function doesn't work. It's a local script inside of a text button, I'd really appreciate some help.

Here's the script:

function onClicked()
	game.StarterGui.ScreenGui2.Frame2.Visible = true
end

script.Parent.MouseButton1Click:connect(onClicked)

All the names and parents are correct. I don't know what I'm doing wrong?

1 answer

Try using :WaitForChild() instead of just trying to find them using .NameOfAssetHere.

This discussion is preserved as it was. New answers, comments, and votes are closed.