generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How would I use MouseEvents to detect...

Previous Thread :: Next Thread 
oni0n is not online. oni0n
Joined: 04 Nov 2012
Total Posts: 2975
11 Sep 2015 06:19 AM
.. If I'm double-tapping a key?

Also, if you want to tell me that MouseEvents are depreciated, piss off.



cout << "Proof by analogy is fraud." << endl; //Bjarne Stroustrup
Report Abuse
oni0n is not online. oni0n
Joined: 04 Nov 2012
Total Posts: 2975
11 Sep 2015 06:39 AM
Bump



cout << "Proof by analogy is fraud." << endl; //Bjarne Stroustrup
Report Abuse
oni0n is not online. oni0n
Joined: 04 Nov 2012
Total Posts: 2975
11 Sep 2015 07:09 AM
Bump 2



cout << "Proof by analogy is fraud." << endl; //Bjarne Stroustrup
Report Abuse
davisky2 is not online. davisky2
Joined: 04 Mar 2012
Total Posts: 4710
11 Sep 2015 07:13 AM
Try detecting when user presses/clicks the key and wait if they do it quick enough so it counts as double click.


~davisky~
Report Abuse
oni0n is not online. oni0n
Joined: 04 Nov 2012
Total Posts: 2975
11 Sep 2015 07:37 AM
Heck no.
Report Abuse
oni0n is not online. oni0n
Joined: 04 Nov 2012
Total Posts: 2975
11 Sep 2015 08:09 AM
BUMP GOSH DARNIT



cout << "Proof by analogy is fraud." << endl; //Bjarne Stroustrup
Report Abuse
Fribet is not online. Fribet
Joined: 08 Feb 2014
Total Posts: 700
11 Sep 2015 08:10 AM
Try detecting when user presses/clicks the key and wait if they do it quick enough so it counts as double click.[2]
Report Abuse
CaptainGector is not online. CaptainGector
Joined: 02 May 2014
Total Posts: 487
11 Sep 2015 09:10 AM
Mouse Keypressed connect function(key)
if key == var name then
Mouse . keypressed connect function(double key)
if double key == var name then
blah blah blah
Report Abuse
oni0n is not online. oni0n
Joined: 04 Nov 2012
Total Posts: 2975
11 Sep 2015 10:11 AM
Thank you, someone who can give me a practical example.



cout << "Proof by analogy is fraud." << endl; //Bjarne Stroustrup
Report Abuse
IDKBlox is not online. IDKBlox
Joined: 05 Apr 2013
Total Posts: 1304
11 Sep 2015 11:01 AM
Try detecting when user presses/clicks the key and wait if they do it quick enough so it counts as double click.[3]
Report Abuse
EradicateTheNoobs is not online. EradicateTheNoobs
Joined: 03 Feb 2012
Total Posts: 1314
11 Sep 2015 11:03 AM
Try detecting when user presses/clicks the key and wait if they do it quick enough so it counts as double click.[4]


stupid kid thinks were slaves, get the hell out
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
11 Sep 2015 11:08 AM
rofl



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$668 Tx1,986
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
11 Sep 2015 11:51 AM
UIS u peasant

local uis = game:GetService("UserInputService")
local threshold = .5 -- how much time the client has to double tap a key for it to be registered as a double tap

local function listenForDoubleTapInput(KeyCode)
local connection
connection = uis.InputBegan:connect(function(input, gpe)
if not gpe and input.KeyCode == KeyCode then
local timer = tick()
local inputt, gpe = uis.InputBegan:wait()
if inputt.KeyCode == KeyCode and not gpe then
local elapsedTime = timer - tick()
if elapsedTime <= threshold then
connection:disconnect()
print(game.Players.LocalPlayer.Name.." doubled tapped the "..inputt.KeyCode.Name.." key!")
return inputt.KeyCode, elapsedTime
end
end
end
end
end

-- when you want to listen for a double tap
local keyCode, elapsedTime = listenForDoubleTapInput(Enum.KeyCode.Space)
print(keyCode, elapsedTime)

do something similar to this (if it works, didn't test)
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
11 Sep 2015 11:52 AM
yeah, i forgot closing parentheses around the anonymous function
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
11 Sep 2015 11:55 AM
*local elapsedTime = tick() - timer
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image