Вот мой код
local IconOn = false
local SeatbeltOn = false
local ply = LocalPlayer()
--------------------------------
local BeltIcon = vgui.Create("DImage")
BeltIcon:SetPos(300,700) <---says this is returning nil
BeltIcon:SetSize(50,50)
function DrawIcon()
if LocalPlayer():IsPlayer() and LocalPlayer():InVehicle() and LocalPlayer():Alive() and IconOn == false then
BeltIcon:SetVisible(true)
LocalPlayer():ChatPrint("Icon ON")
BeltIcon:SetImage("dimBelt/seatbeltOff.png")
IconOn = true
elseif LocalPlayer():InVehicle() == false and IconOn == true then
BeltIcon:SetVisible(false)
LocalPlayer():ChatPrint("Icon OFF")
IconOn = false
end
end