I need some help fixing the script, it's a edited script by JJStorm, it somewhat doesn't work, and I do not know why, it's two pieces of codes, it's the Lockpick code and the Baton code as they are both broken, I don't know what to do because I don't know about JVS's new content.
Thanks if you can help.
function CityRPGPicklockImage::onHitObject(%this, %obj, %slot, %col, %pos, %normal)
{
%client = %obj.client;
if(%col.getType() & $TypeMasks::FxBrickObjectType)
{
if($CityRPG::pref::canpicklockadmindoors != 1)
{
if(getrandom(0,3) == 2)
{
%col.JVSOpen(%client);
commandToClient(%client, 'centerPrint', "\c6You have commited a crime. [\c3Breaking and Entering\c6]", 3);
CityRPG_AddDemerits(%client.bl_id, $CityRPG::demerits::breakingAndEntering);
return;
}
else
{
commandToclient(%client, 'centerprint', "\c6Picking Lock...", 3);
}
}
else
{
commandToclient(%client, 'centerprint', "\c6Lock Is unpickable", 3);
}
}
else if(%col.getType() & $TypeMasks::VehicleObjectType)
{
if(%col.locked)
{
%col.locked = false;
CityRPG_AddDemerits(%obj.client.bl_id, $CityRPG::demerits::grandTheftAuto);
commandToClient(%client, 'centerPrint', "\c6You have committed a crime. [\c3Grand Theft Auto\c6]", 5);
}
}
parent::onHitObject(%this, %obj, %slot, %col, %pos, %normal);
}
This code, the door does not open for some strange reason.
function CityRPGBatonImage::onHitObject(%this, %obj, %slot, %col, %pos, %normal)
{
%client = %obj.client;
if(%col.getClassName() $= "fxDTSBrick")
{
%col.JVSOpen(%client);
}
else if(%col.getClassName() $= "Player")
{
if((%col.getType() & $typeMasks::playerObjectType) && isObject(%col.client))
{
if(%col.client.getWantedLevel())
{
if(%col.getDatablock().maxDamage - (%col.getDamageLevel() + 25) < %this.raycastDirectDamage)
{
%col.setDamageLevel(%this.raycastDirectDamage + 1);
%col.client.arrest(%client);
}
else
commandToClient(%client, 'CenterPrint', "\c3" @ %col.client.name SPC "\c6is resisting arrest!", 3);
}
else if(CityRPGData.getData(%col.client.bl_id).valueBounty > 0)
commandToClient(%client, 'CenterPrint', "\c3" @ %col.client.name SPC "\c6is not wanted alive.", 3);
else
%doNoEvil = true;
}
}
if(%doNoEvil) { %this.raycastDirectDamage = 0; }
parent::onHitObject(%this, %obj, %slot, %col, %pos, %normal);
if(%doNoEvil) { %this.raycastDirectDamage = 25; }
}