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

Is there a function with surface GUIs that allow you to click them and activate an event?

If so, how? If you could help that'd be wonderful.

1 answer

✓ Accepted answer

No, but you could insert in a ClickDetector which would work just as well. Lets say that the part the SurfaceGui is adorned to is the scripts parent:

local Obj = script.Parent
local Clicker = Instance.new("ClickDetector")
Clicker.MaxActivationDistance = 1/0
Clicker.Parent = Obj

Clicker.MouseClick:connect(function(Player)
	--What you want to happen here
end)

This would put the ClickDetector in the part that the SurfaceGui is adorned to, then you can put what you want to happen where I put the comment.

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