Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to use ClickDetector?

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

1 answer

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)

12 comments

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.

0

Thanks a lot

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?

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!

0

Sure, I just like helping people with CS, I'm not very active in the Roblox community though.

0

You joined 3/11/15.

0

Yeah, I didn't like my original account and wanted to start new

0

Really? BTW you know someone is going around the site thumbing down every answer and question so people can have negative reputation?

0

That would explain why my perfectly legitimate answers have been down voted.

0

I accepted your question

0

Are you sure, it doesn't say so?

This discussion is preserved as it was. New answers, comments, and votes are closed.