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?
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