So, Im trying to make a gravity tank, but its missing the cannon. How do I fix this? I only know simple scripting, so if you could edit the script to make it appear and shoot, I will give you credit. Thanks.
$GravityTankTypemasks=$typemasks::fxbrickobjecttype | $typemasks::interiorobjecttype | $typemasks::terrainobjecttype | $typemasks::StaticObjectType;
datablock wheeledvehicledata(GravityTankVehicle : TankVehicle){
cameraRoll=true;
cameramaxdist=8;
cameraoffset=0;
uiname="Gravity Tank";
};
function GravityTankVehicle::onadd(%this,%obj){
%obj.isshiftinggravity=1;
%obj.grav="0 0 -0.5";
shiftgravitycheck(%obj);
parent::onadd(%this,%obj);
}
function shiftgravitycheck(%obj){
if(!%obj.isshiftinggravity)
return;
%pos=%obj.getposition();
%ray=containerraycast(%pos,vectoradd(%pos,vectorscale(%obj.getupvector(),"-4 -4 -4")),$GravityTankTypemasks,%obj);
%normal=getwords(%ray,4,6);
if(%normal!$="")
%obj.grav=vectorscale(%normal,"-0.5 -0.5 -0.5");
%obj.setvelocity(vectoradd(%obj.getvelocity(),vectoradd("0 0 0.5",%obj.grav)));
schedule(25,0,shiftgravitycheck,%obj);
}