I need this for my player type shooter
When the player will press the jet button, he will do sprint forward and he will lose energy with animation of Am_activate2
If someone can help me by giving me a code for the option I will release the player type. please help.
I suck at scripting, I tried to put a code from Gamemode_Zapt, but it didn't work:
function BlockRiotPHoleBot::Special(%this, %obj)
{
%energy = %obj.getEnergyLevel();
if(%energy >= 15)
{
%mount = %obj.getObjectMount();
if(!isObject(%mount))
{
%start = %obj.getPosition();
%end = vectorSub(%start, "0 0 1");
%masks = ($TypeMasks::FxBrickObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::StaticObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::VehicleObjectType);
%ground = getWord(containerRayCast(%start, %end, %masks, %obj), 0);
if(isObject(%ground))
{
%aimVec = %obj.zombieAimVec();
%obj.setVelocity(vectorScale(%aimVec, 18));
%obj.setEnergyLevel(%energy - 15);
%obj.playThread(2, "jump");
return true;
}
}
else if(%energy >= 50)
{
%start = %mount.getPosition();
%end = vectorSub(%start, "0 0 1");
%masks = ($TypeMasks::FxBrickObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::StaticObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::VehicleObjectType);
%ground = getWord(containerRayCast(%start, %end, %masks, %obj), 0);
if(isObject(%ground))
{
%aimVec = %obj.zombieAimVec();
%mount.setVelocity(vectorScale(%aimVec, 12));
%obj.setEnergyLevel(%energy - 35);
%mount.playThread(2, "jump");
return true;
}
}
}
return false;
}
Sorry for bad English