|
| 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
|
  |
| 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 |
|
|
|
| 11 Jan 2015 10:43 AM |
| I guess I shouldve specified the language.. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 11 Jan 2015 10:48 AM |
| Thing is, I've tried the conecept behind that 3 times. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 11 Jan 2015 10:50 AM |
| The simplicity that will probably solve this problem.. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 11 Jan 2015 10:51 AM |
| (I totally just wrote that exccuuuuuse me) |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2015 10:51 AM |
| change the first local doubled=true, to false |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2015 10:54 AM |
| After rereading mine over and over I see no reason why it shouldn't work |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|