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:
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:
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:
$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.