Bump. THis isn't going to be like Desolations. This is going to be more of a style where you get to build a town or a shop and such. Hopefully someone can fix this.
function CityRPGLumberjackProjectile::onCollision(%this, %obj, %col, %fade, %pos, %normal)
{
Parent::onCollision(%this, %obj, %col, %fade, %pos, %normal);
%brickData = %col.getDatablock();
if(%brickData.isTree)
{
%col.onChop(%obj.client);
}
parent::oncollision(%this, %obj, %slot, %col, %pos, %normal);
}
function fxDTSBrick::onChop(%this, %client)
{
if(%this.resources > 0)
{
%random = getRandom(1,100);
if(%random >= 65)
{
%this.resources--;
if(%this.resources > 0)
commandToClient(%client, 'centerPrint' , "\c6Lumber obtained.", 1);
else
{
commandToClient(%client, 'centerPrint' , "\c6Lumber obtained, however you killed the tree in the process.", 3);
%this.fakeKillBrick(getRandom(-10, 10) SPC getRandom(-10, 10) SPC getRandom(0, 10), getRandom(120, 180));
%this.resources = %this.getDatablock().resources;
}
%client.player.Roleplay["Lumber"] += 1;
%client.Roleplay["WoodcuttingXP"] += 1;
}
}
}
It spams the console with
base/server/scripts/allGameScripts.cs (9477): Unable to find object: '' attempting to call function 'getType'
BackTrace: ->CityRPGLumberjackProjectile::OnCollision->ProjectileData::OnCollision
I am using the city rpg axe script for now.