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

how do I see if someone pressed a key or clicked twice?

I am making a game where it requires the player to click twice? How do i do this?

script.Parent.ClickDetector.MouseClick:Connect(function(player)
if script.Parent.ClickDetector.MouseClick:Connect(function(player) then
print (5)
end)
end)

Please help!

1 answer

✓ Accepted answer

You could probably get away with a single mouse click, but if you do need double click then you can do this:

local clicks = 0
script.Parent.ClickDetector.MouseClick:Connect(function(player)
	clicks = clicks + 1
	if clicks >= 2 then
		--put here what you need
		clicks = 0 
	end
end)

Should work.

4 comments

0

THANK YOU SO MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0

Is it possible to do it with keys

0

It is possible, but it's more difficult!

0

Ok you don't need to but thank you

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