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

Is there such thing as an OnClick Functions?

Asked by
F_lipe 135
10 years ago

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?

1 answer

Log in to vote
1
Answered by
Dominical 215 Moderation Voter
10 years ago

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

Ad

Answer this question