Blockland Forums > Modification Help
Parent::onSpawn(); Errors
FFSO:
I was fooling around hopelessly for ideas on an addon and there was an syntax error in my code, it must be a beginners mistake or something like that since I have no idea what is wrong...Here is the code
package NRPGMC
{
function GameConnection::onSpawn(%client)
{
%this.hatColor = "5 0.633 0.456 2";
%this.secondPackColor = "1 1 0 2";
%this.chestColor = "2 0.125 0.233 2";
%this.rArmColor = "5 0.1215 0.716 2";
%this.lArmColor = "1 0.754 0.346 2";
%this.hipColor = "2.01 0.12 0.125 2";
%this.decalName = "NRPG Player";
}
Parent::onSpawn(%client);
};
activatePackage(NRPGMC);
The syntax error line is in Bold.
otto-san:
--- Quote from: FFSO on October 14, 2011, 05:53:59 PM ---package NRPGMC
{
function GameConnection::onSpawn(%client)
{
parent::onSpawn(%client);
%this = %client.player;
%this.hatColor = "5 0.633 0.456 2";
%this.secondPackColor = "1 1 0 2";
%this.chestColor = "2 0.125 0.233 2";
%this.rArmColor = "5 0.1215 0.716 2";
%this.lArmColor = "1 0.754 0.346 2";
%this.hipColor = "2.01 0.12 0.125 2";
%this.decalName = "NRPG Player";
}
Parent::onSpawn(%client);
};
activatePackage(NRPGMC);
--- End quote ---
FFSO:
edit: Why is there Parent::onSpawn() twice?
Greek2me:
Remove the second copy of it in Otto's code and it should work fine.
otto-san:
--- Quote from: Greek2me on October 14, 2011, 06:02:50 PM ---Remove the second copy of it in Otto's code and it should work fine.
--- End quote ---
I didn't even notice that lol.