How check if DModelPanel is already made?

Here is the error:
[ERROR] addons/darkrpmodification/lua/darkrp_modules/hudreplacement/cl_hudreplacement.lua:211: ‘)’ expected (to close ‘(’ at line 210) near ‘if’

  1. unknown - addons/darkrpmodification/lua/darkrp_modules/hudreplacement/cl_hudreplacement.lua:0
    Here is the code:
    hook.Add(“HUDPaint”, “DrawHUD”, drawHUD
    if loop == false then portrait() end
    end)

[editline]1st August 2016[/editline]

Changed thread



hook.Add("HUDPaint", "DrawHUD", drawHUD


Should be



hook.Add("HUDPaint", "DrawHUD", function()


After doing this it won’t draw the whole HUD? I just wanted it to only draw the DModelPanel once not continuously