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

Button click feature?

I wanted to know how you could run something with the button feature. Not

function onTouch(part)

end
example.Touched:connect(onTouched)

But actually making it so you can use your mouse to click it.

2 answers

✓ Accepted answer

To do this simple insert a click detector into a part and write the following

script.Parent.ClickDetector.MouseClick:connect(function(player)
--Code here
end)

Next time, try including

function onClick() --Instead of onTouch
--CODE HERE--
end
script.Parent.ClickDetector.MouseClick:connect(onClick) --Where it says Parent.ClickDetector, make it so it is wherever your clickdetector is

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