Blockland Forums > Modification Help

OnTrigger package won't do anything. At all.

Pages: (1/2) > >>

The Titanium:


--- Code: ---package TF2MinigunAltFire
{
function Armor::onTriggerDown(%this,%obj,%slot,%val)
{
if(%obj.getMountedImage(0) $= TF2MinigunIdleImage.getID() && %slot $= 4 && %val)
{
%obj.TF2MinigunTriggerdown = 1;
%obj.setImageAmmo(0, 0);
schedule(500,0,TF2MinigunTriggerDown,%obj);
}
if(%obj.getMountedImage(0) $= TF2MinigunIdleImage.getID() && %slot $= 4 && %val $= 0)
{
%obj.TF2MinigunTriggerdown = 0;
%obj.setImageAmmo(0, 1);
}
if(%obj.getMountedImage(0) $= TF2MinigunImage.getID() && %slot $= 4 && %val)
{
%obj.TF2MinigunTriggerdown = 1;
%obj.setImageAmmo(0, 0);
schedule(500,0,TF2MinigunTriggerDown,%obj);
}
if(%obj.getMountedImage(0) $= TF2MinigunImage.getID() && %slot $= 4 && %val $= 0)
{
%obj.TF2MinigunTriggerdown = 0;
%obj.setImageAmmo(0, 1);
}     
Parent::onTriggerDown(%this,%obj,%slot,%val);
}

};
activatePackage(TF2MinigunAltFire);

function TF2MinigunTriggerDown(%obj)
{
if(%TF2MinigunTriggerDown == 1)
{
%obj.setImageAmmo(0, 0);
schedule(500,0,TF2MinigunTriggerDown,%obj);
}
if(%TF2MinigunTriggerDown == 0)
{
%obj.setImageAmmo(0, 1);
}
}
--- End code ---
Yes, I know there was a better way to organize the different if statements, as they had very similar characteristics, but it's not what I am talking about. It's just that whatever I do, whatever I put in there, I am certain that this script simply does nothing. Is there something someone can please tell me that I am doing wrong?

HellsHero:

Isn't it armor::onTrigger() not armor::onTriggerDown()?

The Titanium:

...right
let me try that

MegaScientifical:

Ya, I think that the definition of location is one of the variables to the function, and not part of the function name.

HellsHero:


--- Quote from: MegaScientifical on August 27, 2010, 12:50:43 PM ---Ya, I think that the definition of location is one of the variables to the function, and not part of the function name.

--- End quote ---
If I understand what you mean, %val is it.

Pages: (1/2) > >>

Go to full version