|
| 01 Aug 2011 07:37 PM |
In lua, can you make a tool do somthing with a **RIGHT** mouse click ONLY, and if so, can you have it so if you left click, it does one thing, while if you right click, it does somthing else??
You see, I'm making a custom staff of mine, Staff of Azure Ever Ice with no reload time and a melee feature. I want it so that if I right click, it does the melee move from another weapon script (The melee script works fine, but only when it's the only combat script in the tool.). If the top paragraph is possible, please tell me what to write in order to launch the melee script via RIGHT mouse click,
I get this idea because I saw "mouseclick1" or somthing like that (Again, it may not be exact, but it's simaller to that term", that lead me to think if whether or not that meant which button on the mouse you clicked.
I want to really bad, but If I ask people to make that mouse script for me, that'd be a request, and you would all hate me, 'cause haters gonna hate. So, if you could help me, great, I appreciate it. If you could follow through with me and see the staves and such, even better.
The scripts currently in the staff are not needed in this forum. If I knew how to swich between mouse buttons, I can edit them myself.
If you read all that... THANKYOU! |
|
|
| Report Abuse |
|
|
Ulla42
|
  |
| Joined: 14 Dec 2009 |
| Total Posts: 1774 |
|
| |
|
|
| 01 Aug 2011 07:39 PM |
You'll have to use a Text/ImageButton for the right click since Tools/HopperBins don't support right clicks.
It IS possible, but I don't recommend the method (however, I did use it in my ADS experiments). |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 07:39 PM |
| One problem, mouse.Button2Down doesn't fire |
|
|
| Report Abuse |
|
|
Ulla42
|
  |
| Joined: 14 Dec 2009 |
| Total Posts: 1774 |
|
| |
|
Ulla42
|
  |
| Joined: 14 Dec 2009 |
| Total Posts: 1774 |
|
|
| 01 Aug 2011 07:41 PM |
Also, It's not "mouse.Button2Down" It's MouseButton2Down |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 07:41 PM |
| He's using a TOOL, not a GUI. |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 07:43 PM |
MouseButton2Down --This is in a GUI, and this does, in fact, fire. mouse.Button2Down -- This is in a Tool/Hopperbin, and it doesn't fire. |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 07:44 PM |
| Ah yes, what I saw was "Mousbutton1down". And I belive I saw that within the tool script. |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 07:49 PM |
Okay, so recap.
If I use "Mousebutton1down", that is left click and "Mousebutton2down" is right?
What would be the correct line if I wanted to do this (I'll use some lua terms in it):
if Mousebutton2down was clicked then ... |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 07:53 PM |
| No. MouseButton1Down is right, MouseButton2Down is left. You NEED correct capitalization in scripting. |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 07:53 PM |
| Wups... I meant MouseButton1Down is left, MouseButton2Down is right... |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 07:57 PM |
Yes yes, I realized I capitalized wrong 2 seconds after I posted. It would be stupid to post again just to fix errors.
So if MouseButton1Down is right click, then that is the button that is less used? You click just about everything with your left mouse button. And still, how would I have it so if I right mouse click, it would trigger the rest of the script? I am very unfamiliar with the mouse in lua, and am unaware of its properties. |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 07:58 PM |
| .___________________________. You posted while I was typing, and I suspected the MouseButton's were mixxed up in your post... |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 08:05 PM |
Bump.
Main question still remains!
"How would I have it so if I right mouse click, it would trigger the rest of the script? I am very unfamiliar with the mouse in lua, and am unaware of its properties."
Answer it to get the immaginary golden cookie dispencer. |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 08:13 PM |
Bump.
Main question still remains!
"How would I have it so if I right mouse click, it would trigger the rest of the script? I am very unfamiliar with the mouse in lua, and am unaware of its properties."
Answer it to get the immaginary golden cookie dispencer.
|
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 08:16 PM |
In a tool, a script triggered by the left mouse button would look something like this:
local t = script.Parent
t.Selected:connect(function(mouse) mouse.Button1Down:connect(function() --Stuff end) end) |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 08:21 PM |
| Selected is not a valid member of Tool |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 08:24 PM |
| I tried equipted too. It did not work either. |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 08:24 PM |
| You're right. I'm sorry, that script is for HopperBins. |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 08:25 PM |
| Actually, it's spelt "Equipped". |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 08:37 PM |
| Oh, haha, I made another typo? yes, equipped. |
|
|
| Report Abuse |
|
|
scepile3
|
  |
| Joined: 27 Feb 2009 |
| Total Posts: 260 |
|
|
| 01 Aug 2011 09:16 PM |
Equipped has to be capitalized also, since capitalization is also vital in scripting... '.'
Also, you might want to use print() to make sure the right click event ever fires... '.' |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 10:38 PM |
http://www.roblox.com/Right-Click-Tool-HopperBin-item?id=58197624
Please read the description before taking it. |
|
|
| Report Abuse |
|
|