Blockland Forums > Modification Help
Script breaks activations?
Bauklotz:
--- Quote from: aml on November 07, 2010, 02:16:12 PM ---
--- Code: ---package testplayer
{
function Armor::onTrigger(%this,%obj,%trigger,%val)
{
if(%trigger == 4)
{
if(%this.getName() $= "PlayerTest" && %val == 1)
{
%obj.changeDatablock(PlayerTestInvisible);
%obj.hidenode("All");
}
else if(%this.getName() $= "PlayerTestInvisible" && %val == 0)
{
%obj.changeDatablock(PlayerTest);
%obj.unhideNode("All");
}
}
Parent::onTrigger(%this,%obj,%trigger,%val);
}
};
activatepackage(testplayer);
--- End code ---
--- End quote ---
Should be solved. Problem: Invalid amount of arguments.
aml:
--- Quote from: Bauklotz on November 09, 2010, 08:49:53 PM ---Should be solved. Problem: Invalid amount of arguments.
--- End quote ---
Well thanks for the help on that.
It doesn't hide any of the nodes though, but I think I might be able to fix that.
MegaScientifical:
I think the "ALL" is case sensitive. Uppercase it.
aml:
--- Quote from: MegaScientifical on November 09, 2010, 09:11:26 PM ---I think the "ALL" is case sensitive. Uppercase it.
--- End quote ---
Yeah it is case sensitive, fixing now.
Bauklotz:
You might also want to "hide" the shapename by using %obj.setShapeNameDistance(10); (10 is lowest) - to make it be less buggy, you might also want to package ::setShapeNameDistance to change distance to 10 all the time if they are "invisible".