![]() |
leftmousebutton problem
So i'm doing a kind of panel, basically i want to show it when you click on the panel image:
http://puu.sh/4h7Lc.png But when i click, (everywhere else, don't matter if its on the image or not), it shows correctly. How can i make it show only if i click on the image? Class: PHP Code:
|
First of all, please style your code before posting it. Secondly, put that check into a function. Third, leftmousebutton is a boolean indicating whether the left mouse button is pressed or not. It doesn't have anything to do with whether the mouse is over top of your object or not. For that check mousex and mousey. Something like:
PHP Code:
|
Quote:
Thanks for confirming this. I thought it was weird he wasn't checking if the sign itself was clicked, but didn't want to give him bad advice. |
1 Attachment(s)
You need to use a function to catch if the left mouse button is pushed. Usually GraalControl.onMouseDown()
I modified the script some, the forums still don't allow me to post PHP sometimes, so I've just attached it in a txt file. |
Quote:
Have you considered catching the mouse event when the player clicks the NPC rather then catching it at every click and comparing x/y's in a range? You can then trigger an action to open the GUI |
Ok everyone, everything is working so far :).
Thanks alot! And sorry, i'm starting scripting |
Feel free to pm me anytime if you have any questions. =]
|
| All times are GMT +2. The time now is 04:44 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.