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

How to use ClickDetector?

Asked by 9 years ago

How to make an "if" statement with the ClickDetector, for example, if someone clicks a block make something happen

1 answer

Log in to vote
1
Answered by 9 years ago

Pretend I have a brick in the workspace called "Part" and inside it is a ClickDetector and a Script

local brick = script.Parent;
brick.ClickDetector.MouseClick:connect(function()
    --Put your code here
end)
0
Also, now Roblox allows you to see who clicked. If you want to know who clicked, put a variable name inside the function parameter. DewnOracle 115 — 9y
0
Thanks a lot MatiasSicarius 45 — 9y
0
No problem! One more thing, I noticed that you tagged this under local scripts, click detection must be put in regular scripts. Anyways, can you accept my answer if it helped you? DewnOracle 115 — 9y
0
Hi Dewn, You're new. Like today new. Anyway... Can I send you a friend request? I have over 200 reputation, I think you can get there too pretty fast. BTW I played roblox in 2008 as a guest! EzraNehemiah_TF2 3552 — 9y
View all comments (8 more)
0
Sure, I just like helping people with CS, I'm not very active in the Roblox community though. DewnOracle 115 — 9y
0
You joined 3/11/15. EzraNehemiah_TF2 3552 — 9y
0
Yeah, I didn't like my original account and wanted to start new DewnOracle 115 — 9y
0
Really? BTW you know someone is going around the site thumbing down every answer and question so people can have negative reputation? EzraNehemiah_TF2 3552 — 9y
0
That would explain why my perfectly legitimate answers have been down voted. DewnOracle 115 — 9y
0
Yep. I got 2 down votes on this answer. https://scriptinghelpers.org/questions/15487/how-to-detect-if-a-player-presses-a-key-answered#18597 EzraNehemiah_TF2 3552 — 9y
0
I accepted your question MatiasSicarius 45 — 9y
0
Are you sure, it doesn't say so? DewnOracle 115 — 9y
Ad

Answer this question