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

SurfaceGUI text button won't detect being click?

I have a local script, inside a text button, inside a surfacegui, inside a part, inside of workspace.

My local script

script.Parent.Activated:Connect(function(plr)
	print("ok")
	plr.PlayerGui.ScreenGui.Laptop.Visible = true
end)

Thanks!

1 answer

Since you are trying to detect when the text button is being click, you would use .MouseButton1Click

script.Parent.MouseButton1Click:Connect(function(plr)
	print("ok")
	plr.PlayerGui.ScreenGui.Laptop.Visible = true
end)

4 comments

0

That didn't work

0

Try and put that inside of a normal script, it worked for me that way, unless you need it to be a local script for some reason

0

I am making a gui be visible, doesn't that need to be a local script

0

otherwise all players in the game will have their gui visible

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