So last week i opend a topic about detecting if it were hitting a certain brick type but now i need to check if it is hitting the certain type of brick heres the code
function serverCmdLight(%client, %brick)
{
%player = %client.player;
if(!isObject(%object = getWord(containerRaycast(%player.getEyePoint(), vectorAdd(%player.getEyePoint(), vectorScale(%player.getEyeVector(), 7)), $TypeMasks::FxBrickObjectType),0)))
return;
if(%object.getDatablock() == ScrapElectronicsBrickData.getID())
{
%client.backPack["ScrapElectronics"]++;
%client.backPack["Weight"] += 2;
echo(%client.backPack["ScrapElectronics"]);
}
There is nothing wrong with this code i just need to know what i change getDatablock() to