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
 

Check if held down click or double clicked?

Previous Thread :: Next Thread 
CrescentJade is not online. CrescentJade
Joined: 07 Jul 2010
Total Posts: 5494
11 Jan 2015 10:39 AM
I wanna see if a player either, held down the left click or double clicked it. How to do so?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
11 Jan 2015 10:42 AM
int clicks = 0;
mouseDown >> {
clicks = clicks + 1;
down = true;
if clicks > 1 then
// Double click
end
wait(0.8); // Interval between clicks to count as a doubleClick
clicks = clicks - 1;
}
mouseUp >> down = false;
Report Abuse
CrescentJade is not online. CrescentJade
Joined: 07 Jul 2010
Total Posts: 5494
11 Jan 2015 10:43 AM
I guess I shouldve specified the language..
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
11 Jan 2015 10:45 AM
No, since that isn't any programming language I immediately know of. It's a medley of C#(Java) style syntax and Lua/python style syntax.

It should still cover all of the concept behind it.
Report Abuse
CrescentJade is not online. CrescentJade
Joined: 07 Jul 2010
Total Posts: 5494
11 Jan 2015 10:48 AM
Thing is, I've tried the conecept behind that 3 times.
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
11 Jan 2015 10:49 AM
local clicked=false
mouse.Button1Down:connect(function()
clicked=true
end)
mouse.Button1U:connect(function()
clicked=false
end)
Report Abuse
CrescentJade is not online. CrescentJade
Joined: 07 Jul 2010
Total Posts: 5494
11 Jan 2015 10:50 AM
The simplicity that will probably solve this problem..
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
11 Jan 2015 10:51 AM
local clicked=false
local hold=false
local double=true
local clicked=0
mouse.Button1Down:connect(function()
clicked=true
wait(.1)
if clicked then
hold=true
elseif clicked==2 then
double=true
else
double=false
end
end)
mouse.Button1Up:connect(function()
clicked=false
hold=false
end)
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
11 Jan 2015 10:51 AM
(I totally just wrote that exccuuuuuse me)
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
11 Jan 2015 10:51 AM
change the first local doubled=true, to false
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
11 Jan 2015 10:54 AM
After rereading mine over and over I see no reason why it shouldn't work
Report Abuse
CrescentJade is not online. CrescentJade
Joined: 07 Jul 2010
Total Posts: 5494
11 Jan 2015 11:04 AM
I just used the simple start you gave me and remade it, But if that glitches out some times ill be sure to appreciate your full method!
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