The 'weird green box' is the trigger. Sometimes I crash while in F11 if I select something, go to F3 (Properties Inspector), delete it and attempt to edit its properties.
I think it's either related to the problem above, or to do with this:
if(getSubStr(%col.dataBlock,0,5) $= "brick")
{
//Other coding above to do with other Team Set Gun modes
if(%obj.client.GunMode == 8)
{
%i = new Trigger() {
position = getWord(%col.getTransform(),0) - 0.5 SPC getWord(%col.getTransform(),1) + 0.5 SPC getWord(%col.getTransform(),2);
rotation = "1 0 0 0";
scale = "1 1 1.2";
dataBlock = GreenTeamSetTrigger;
polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
};
%i.isTeamDM = 1;
%i.brick = %col;
messageClient(%obj.client,"","\c3Brick set as Team 3 (\c2green\c3) Join Trigger.");
}
//Other coding to do with checking modes.
}
(From Team DM Mod)
Try copying the Polyhedron line into your script, I think that may be the problem. You could use the Position and Is Brick check as well. 1 Torque Unit = 2 studs.
I don't think that triggers are a very good method - you hit them with your 'bounding box', which is much larger than the actual 'you' - look at yourself in F11. Try having this code:
function lolplsProjectile::onCollision(%this, %obj, %col, %fade, %pos, %normal)
{
if(getSubStr(%col.dataBlock,0,5) $= "brick")
{
if(%col.lolpls)
{
messageClient(%obj.client,"","\5Brick no longer \c0lolpls\c5.");
%col.lolpls = 0;
}
else
{
messageClient(%obj.client,"","\5Brick now a \c0lolpls\c5 brick.");
%col.lolpls = 0;
}
}
}
package ImpactChecker
{
function Armor::onImpact(%this, %obj, %collidedObject, %vec, %vecLen)
{
if(%collidedObject.lolpls)
{
//Execute whatever code you want.
}
Parent::OnImpact(%this, %obj, %collidedObject, %vec, %vecLen);
}
}
ActivatePackage("ImpactChecker");