Author Topic: onTrigger [Solved]  (Read 2564 times)

Code: [Select]
         function Armor::onTrigger(%this, %player, %slot, %val)
I want to change this into something like onTriggerUp or onTriggerDown, so that when you hold the right mouse button it does something but when you lift up it stops. Is there any way to do this?
« Last Edit: April 23, 2012, 12:55:38 PM by Aware »

I'm not sure what value of %slot corresponds to the right mouse button, but the function is called with a %val of 1 when you press it, and 0 when you release it

So something like

Code: [Select]
function Armor::onTrigger(%this,%player,%slot,%val)
{
if(%slot == )
{
if(%val)
//do stuff when button is pressed
else
//do stuff when button is let go off

}
}
« Last Edit: April 21, 2012, 11:59:24 AM by Headcrab Zombie »

I'm not sure what value of %slot corresponds to the right mouse button, but the function is called with a %val of 1 when you press it, and 0 when you release it

So something like

Code: [Select]
function Armor::onTrigger(%this,%player,%slot,%val)
{
if(%slot == )
{
if(%val)
//do stuff when button is pressed
else
//do stuff when button is let go off

}
}

Okey thanks, i'll try it. And slot is like crouch, jump, right click, left click; slot == 4 is right click

0: activate
1: use
2: jump
3: crouch
4: jet

0: activate
1: use
2: jump
3: crouch
4: jet
When exactly is used called? And 4 is jet and/or right click.

When exactly is used called? And 4 is jet and/or right click.

Well, that's an add-on trigger. It's called when you press the "Use Key".

I thought 0 was when your character flails his right hand and 1 was when he flails his left hand?

Like, guns akimbo does that at least or maybe I am completely wrong again.

I thought 0 was when your character flails his right hand and 1 was when he flails his left hand?

Like, guns akimbo does that at least or maybe I am completely wrong again.
triggers don't really have anything to do with animations besides playing them sometimes