Blockland Forums > Suggestions & Requests

Server-Sided Speedometer (Bottom print)

Pages: << < (3/3)

Who Cares99:


--- Quote from: Masterlegodude on February 08, 2014, 01:32:07 AM ---That old Box Train vehicle has a SpeedCheck script that has a brick per second speedometer, you could use that for various vehicles

I gave it a shot, i can't seem to get it to work, but it also returns no errors in the console

--- Code: ---package VehicleSpeedometer
{
   function VehicleSpeedometer(%data, %obj)
   {
if(!isObject(%obj))
return;
%vehicle = %obj;
%speed = vectorLen(%obj.getVelocity());
if(!%vehicle.oldSpeed)
    %vehicle.oldSpeed = %speed;

if(%speed < 0)
    %speed = 0;
%vehicle.oldSpeed = %speed;
commandtoclient(%vehicle.getControllingClient(),'bottomprint', mFloor(%speed *2) @"<color:FFFF00>BPS", 1);
   
      schedule(500,0,"VehicleSpeedometer",%data,%obj);
   }
};
activatePackage(VehicleSpeedometer);

function vehicle::onadd(%data, %obj)
{
   parent::onadd(%data,%obj);
   VehicleSpeedometer(%data, %obj);
}
--- End code ---
I've also tried putting the function in the package, same results

--- End quote ---

I'm aware of that, but I'm wondering if there's an easier way to make it work with all land vehicles than to copy-paste that script into all land vehicles.

Who Cares99:

I would really like to see this made. It doesn't seem like it would take too long and it would be an enormous help.

Pages: << < (3/3)

Go to full version