Author Topic: Help with a playertype  (Read 503 times)

So I want to make a playertype that when you right click, instead of jetting, you run. When you're not holding right click, you simply walk.

So I've found this:
Code: [Select]
Armor::onTrigger

But from what I know, that will be when you press the button, not when you hold it? And I'm not sure if this would work:
Code: [Select]
function Armor::onTrigger()
{
   if ( $canRun == True )
   {
   runForce = 5000;
   maxForwardSpeed = 15;
   //etc...
   }
}

Along with this, I also need to know if I could set a variable to the player's current energy, and what I would use to do so, as well as if this conditional would work in a playertype:
Code: [Select]
$Energy = ?; //How would I set this to the player's current energy?
if ( $Energy == 0 )
{
   maxForwardSpeed = 7; //making them walk if they are out of energy
}
else if ( $Energy == 100 )
{
   $canRun = True;  //It wouldn't work exactly like this, but this
                             //would set a variable to allow them to run again
                             //onTrigger
}

If you need me to post the code for the whole thing as of now, tell me.
« Last Edit: June 22, 2009, 09:36:18 PM by Niliscro »

I thought armor::onTrigger was activated when a person clicks and object, like a jeep for example.

I thought armor::onTrigger was activated when a person clicks and object, like a jeep for example.
I found it in SolarFlare's Katana as the right click :P

You can't change datablock values like that. Also you are using some odd $ variables in there.

You can't change datablock values like that. Also you are using some odd $ variables in there.
I was just taking a wild guess.

Is there even a way to do what I want?