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

How do I do the click script or click action? [closed]

Asked by 9 years ago

I want to make a brick that changes its transparency each individual time it's clicked on, How do I make this script? Also, does the script start with function?

0
This is not a request site. Please do your own research and make an attempt. iaz3 190 — 9y
0
back off SnowbaIIs -2 — 9y

Closed as Not Constructive by evaera

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

Well, to detect a click on a part, you'd need to use a ClickDetector. From that, you can tell when a MouseClick event is fired. Since you haven't attempted this on your own, I'm not going to provide you with a script. You should know the basics, by changing the transparency. I'll just give you the script they provided on the Wiki.

Example:

Workspace.Part.ClickDetector.MouseClick:connect(function(playerWhoClicked)
  print("Part was clicked by: " .. playerWhoClicked.Name)
end)
0
How do I add transparency responding to the click? SnowbaIIs -2 — 9y
Ad