Client:
Local <- FindLocalPlayer ( );
class FPS {
Limit = 30;
Max = 1;
Calculation = 0;
Time = 0;
}
FPS <- FPS ( );
function onScriptLoad ( ) {
FPS.Limit = 255 / FPS.Limit;
FPS.Time = GetTickCount ( ) + 1000;
}
function onClientRender ( ) {
if ( GetTickCount ( ) < FPS.Time ) {
FPS.Calculation = FPS.Calculation + 1;
return;
}
if ( FPS.Calculation > FPS.Max ) {
FPS.Limit = 255 / FPS.Calculation;
FPS.Max = FPS.Calculation;
}
Message ( "[#ffffff]Your FPS: " + FPS.Calculation ); // show FPS
FPS.Calculation = 0;
FPS.Time = GetTickCount ( ) + 1000;
}