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

How can I make a double tapped key script?

I know how to make a regular if key == "" then script but how do you make it so that you have to press the key twice

1 answer

local timeBeforePressingSecond=5

game.Players.LocalPlayer:GetMouse''.KeyDown:connect(function(k)
	local time=os.time''
	game.Players.LocalPlayer:GetMouse''.KeyDown:connect(function(k)
		if((time-os.time'')>=timeBeforePressingSecond)then
			--code
		end
	end)
end)

1 comment

0

Thanks for writing the code for him so he learns nothing... He needs to write his script first then we help him.

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