![]() |
function onMousedown problem
Ok so i have two npcs in a level and they both have
PHP Code:
My problem is when i click on the male i get set as the female. And i don't want to have to keep it the way i have it now where you right click for male and left click for female. |
Quote:
|
Can't trigger weapons from level NPC's.
|
Quote:
|
Quote:
Quote:
I think your problem is that you don't have any x,y conditions. Maybe you are thinking of onActionMouseDown() or whatever? I only think that works serverside or so though, forgot (haven't been doing level npc scripting much in the past 6 months). |
They can't either, as far as I know.
I honestly have no idea how to tackle this. Maybe some of the more savvy clientside/serverside scripters will have some advice. EDIT: I've never been able to triggerserver/clientside from an NPC, at least from putnpc's, maybe you can with NPC's in levels. *shrug* |
onActionMouseDown() will work on any level object that has a shape. You'll need setshape on both sides to get it to work clientside and serverside.
Edit: onMouseDown() is detecting of the mouse button is pressed at all, you'll need to check where the mouse actually is yourself. Would probably be better to set a shape and use the action event instead. Edit2: Btw, I believe its actually onActionLeftMouse() and onActionRightMouse() PHP Code:
PHP Code:
|
function onActionleftmouse() {}
|
Quote:
PHP Code:
|
Quote:
|
Quote:
onMouseDown() is called on all objects on the clientside whenever the mouse button is clicked regardless of where. |
Quote:
|
Hmm i feel a feature request coming.
|
Quote:
|
You can either do what Inverness posted, or simply use the function I posted.
|
You should be using onActionLeftMouse() or onActionRightMouse() for level npcs, remember to define the shape.
|
PHP Code:
|
Quote:
|
Quote:
|
Alright thank you my problem is fixed :D
EDIT: Umm how can i make a bigger range for the person to click? would i do? PHP Code:
|
|0, 5| would mean 0 or 5 or anything between those.
|x, x+5| would mean anything from the NPC's x coordinate to 5 tiles to the right of the x coordinate. And like I said before, if you're clicking on NPCs in levels you should use setShape() and onActionLeftMouse() |
Gotcha makes since, yea i changed to onActionDoublemouse()
|
| All times are GMT +2. The time now is 11:20 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.