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

What is the parameter at the end of the event ClickDetector for how many times they clicked?

I want to know what goes at the end of a MouseClick so I can see how many times they clicked. It didn't work this way ~~~~~~~~~~~~~~~~~ game.Workspace.Part.ClickDetector.MouseClick:Connect(function(click)


 

1 answer

✓ Accepted answer

ClickDetector#MouseClick returns the player instance of who clicked it, not the number of times the ClickDetector has been clicked. You can record this though! Let's create an instance that can log it.

Create an IntValue and set it's parent to the ClickDetector, and name it to "Clicks". Now we will reference it in the script and add on the clicks.

game.Workspace.Part.ClickDetector.MouseClick:Connect(function(player)
	ClickDetector.Clicks.Value = ClickDetector.Clicks.Value + 1
end) 

If you want to get the amount of times it has been clicked, then you can get the value of the IntValue.

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