Since he claimed it fixed itself, I'm going to go ahead and re-solve this.
Original code (formatted for easier reading):
$joinScore=100;
$brickCost=1;
$setScoreOnEnter=1;
package payToPlantBricks
{
function fxDTSbrick::onPlant(%this)
{
Parent::onPlant(%this);
%client = %this.getGroup().client;
if(%client.score > %brickCost-1)
{
%client.score = %client.score - %brickCost;
commandToClient(%client, 'bottomPrint', "\c2You have paid 1 score point to plant this brick.", 1);
}
else
{
commandToClient(%client, 'centerPrint', "You have no more score to plant a brick.", 3);
%this.schedule(0,"delete");
}
}
function GameConnection::autoAdminCheck(%client)
{
Parent::autoAdminCheck(%client);
if($setScoreOnEnter == 1)
{
%client.setScore($joinScore);
}
}
};
activatePackage(payToPlantBricks);
Problem 1: Line 11
%brickCost is never defined. I imagine they wanted to use $brickCost instead.
if(%client.score > $brickCost-1) would be if(score > cost-1 (0)), it would be more logical to use if(score >= cost (1)).
Solution 1:
if(%client.score >= $brickCost)
Problem 2: Line 13
%brickCost is never defined. Use $brickCost instead.
You could also use %client.score-=x; instead of %client.score = %client.score - x;
Solution 2:
%client.score-=$brickCost;
Other things that could be improved:
Line 14:
The command just tells the client they paid 1, even though $brickCost does not have to be 1.
Solution:
commandToClient(%client, 'bottomPrint', "\c2You have paid " @ $brickCost @ " points to plant this brick.", 1);
This will display the cost of the brick instead.
Other than that, it should work fine.