What I’m trying to do:
When the player clicks the button, I’d like that player to say Activated!
(setplayerprop #c,Activated!;). Although I don’t know how to make the game detect it’s clicking the Activate image…
If anyone can help with this, please post below! Thanks.
(THE MOUSE MUST BE CLICKING ON THE IMAGE NOT ANYWHERE)
Script:
//Npc made by Ace
if (playerenters){
if (!isweapon)toweapons -activate;
setstring this.img,ace_activate.png;
timeout = 0.05;
}
if (timeout && isweapon){
showimg 300,#s(this.img),screenwidth/2-60,screenheight-50;
changeimgpart 300,0,0,152,40;
changeimgvis 300,4;
}
timeout = 0.05;
}
[COLOR="#0000FF"]Mouse Flags True When[/COLOR]
leftmousebutton the left mouse button has been pushed
[COLOR="#0000FF"]Mouse Variables Value[/COLOR]
mousescreenx x position of the mouse on the game screen. (in pixels)
mousescreeny y position of the mouse on the game screen. (in pixels)
[COLOR="#0000FF"]Special Symbols Meaning[/COLOR]
in tests if an array/range contains a variable (e.g. 2 in {1,2,3}; x,y in |0,64|)
a few other things as well :3 But yerr those ones are I M P O R T A N T :o
@twiggy
leftmousebutton requires constant checking in a loop and isn’t exactly ideal for guis. Although if you were to make custom commands like mouseReleased you’d definately use that.
A thing I failed to mention is mousedown also provides with it information in #p(0) which says exactly what button was pressed.
Example: