Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Button click feature?

Asked by 9 years ago

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

Log in to vote
1
Answered by 9 years ago

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)

Ad
Log in to vote
1
Answered by 9 years ago

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

Answer this question