GUI button only working once then not working again

I have a GUI Button (imagebutton) that is a back button. Basically when pressed, it goes back to the home screen. If I go back to that same page the back button is located, and press it again after pressing it another time before, it does not work.


script.Parent.MouseButton1Click:Connect(function(plrd)
	script.Parent.Parent.Visible = false
	script.Parent.Parent.Parent.Buttons.Visible = true
end)

Is that code snippet the one that controls the back button?

Are you getting any errors on your Output tab at all? (Head to Studio > Find the View Category > Output Tab)

No errors or any output at all

Try this:

print("This is running")

script.Parent.MouseButton1Click:Connect(function()
    print("Fired")
	script.Parent.Parent.Visible = false
	script.Parent.Parent.Parent.Buttons.Visible = true
end)

It’s outputting the fired but it’s not actually doing anything

Try changing it to a LocalScript if you haven’t done so already?

1 Like

Can’t believe I actually forgot that, that would be the fix, thanks!

1 Like

I didn’t see that cause I didn’t get the notification in time thanks forum

Old Message

Also do make sure to mark the post as a solution that helped you the most! :wink: This is to ensure that members of the Forum are aware about it being solved

Already did right after I sent my reply