Is there such thing as an OnClick function I know there are OnTouch or OnTouched functions but I've forgot the function for when you click something say a button?
✓ ANSWER ACCEPTED
Is there such thing as an OnClick Functions?
1 answer
✓ Accepted answer
Insert a ClickDetector inside the button. Then put this script inside:
script.Parent.MouseClick:connect(function(player)
print(player.Name.." has clicked the button.")
end)
Read more about ClickDetectors here: http://wiki.roblox.com/index.php?title=ClickDetector
This discussion is preserved as it was. New answers, comments, and votes are closed.
