Gamemode FPS problem

Processor: Windows 7 Intel® Core™ i5-2410m CPU @2.30GHz 2.30GHz
System type: 64 OS

Hi all. Only today i’ve started to make my custom gamemode with lua and more stuff. I now can launch it throught menu, so it’s called Loltest :slight_smile: Anyway, i’m joining gm_construct and when joined my fps was only from 4 - 10, no more. Ping was 0 ms When i press Esc or ~ ofcourse my Fps gets on 50. But when i return in game, it’s makes too low. With Sandbox gamemode on gm_bigcity, full of stuff i’ve got 20 - 30 fps, but with my gamemode on gm_construct i’ve got less then 15 fps! And that’s when i’m playing SinglePlayer! What it can be? I had some lua errors when joined gamemode, still i fixed them and my fps doesn’t changed. Its probably because of hud. Code has no errors, still it can be not right placed. The code can looks shitty, because i added it here. Anyways it looks fine and right coded. Still look on it and tell me if there is something to fix. Here is the code:

function HUDHide( myhud )
for k, v in pairs {“CHudHealth”,“CHudBattery”} do
if myhud == v then return false

function GM:HUDPaint()
local ply = LocalPlayer()

local HP = LocalPlayer():Health()
surface.CreateFont( "MyFont", 
                font    = "Tahoma",
                size    = 60,
                weight  = 1000,
                antialias = false,
                shadow = false

surface.SetTextColor( 255, 64, 64, 255)
surface.SetTextPos( 50, 680 )
surface.SetFont( “MyFont” )
surface.SetDrawColor( 50, 150, 50, 255)
surface.DrawText( “HP:”…HP )

local ARM = LocalPlayer():Armor()

surface.SetTextColor( 0,245,255,255)
surface.SetTextPos( 360, 680 )
surface.SetDrawColor( 50, 150, 50, 255)
surface.DrawText( "ARM:"..ARM )