Problem with PostDrawHUD hook

Hello, dear Facepunch users. I have a very dumb question, i think. But please help me:

The problem is: when i creating a simple script like:


drawsmthnow = true

hook.Add("PostDrawHUD", "STMTHLIKEHUD", function() 
if drawsmthnow == true then
draw.RoundedBox(2, 0, 0, 100, 100, Color(0, 0 ,0, 255))
end
end)
 

this black box appears only when i change lua file, but why? Why not righ after join?



if drawsmthnow == true then


you don’t need this, using


if drawsmthnow then


will already evaluate if ‘drawsmthnow’ is 1.

make sure you put it in the right place like autorun etc

use avast

Thanks a lot!