Logo On Hud Isn't Showing

I made a logo on hud script and it works if i execute it client side, but i made it an addon and it isn’t working. It’s just a lua folder then autorun then logo_client.lua in there and logo.png in it. I don’t know what’s wrong.


 local x = ScrW()
local y = ScrH()
local width = 225 -- Change this Based on the width dimension for your logo.
local height = 160 -- Change this Based on the height dimension of your logo.
local DonationLink = http://birdrp.gaming.bz/prometheus/ -- Change this Based on the server's Donation Link.

local Logo = vgui.Create("DImage")
Logo:SetPos( x / 50, y / 50 )
Logo:SetSize( width, height )
Logo:SetImage( "logo.png" )
file.Find( "lua/autorun/logo.png", "BACKGROUND" )

local Button1 = vgui.Create("DButton")
Button1:SetSize( width, height )
Button1:SetPos(x / 50, y / 50)
Button1:SetText("")
Button1.Paint = function(me,w,h)
        surface.SetDrawColor(Color(0,0,0,0))
        surface.DrawRect(0,0,w,h)
    end
Button1.DoClick = function()

	gui.OpenURL( DonationLink )
    
end 

you need to place the .lua file in lua/autorun/client

or place


 if CLIENT then 

on the beginning
and


 end 

at the end

i did that and im getting this error


 Warning: vgui.Create failed to create the VGUI component (DImage)

[ERROR] addons/logoonhud/lua/autorun/logo_client.lua:7: attempt to index local 'Logo' (a nil value)
  1. unknown - addons/logoonhud/lua/autorun/logo_client.lua:7


This part: [lua]local DonationLink = http://birdrp.gaming.bz/prometheus/ – Change this Based on the server’s Donation Link[/lua] should be a string,

[lua]file.Find( “lua/autorun/logo.png”, “BACKGROUND” )[/lua] wat.

Should be like this:

[lua]
local logo = false
local button = false

local x = ScrW()
local y = ScrH()
local width,height = 225,160

function MakeThem()
if !logo then
local Logo = vgui.Create(“DImage”)
Logo:SetPos( x / 50, y / 50 )
Logo:SetSize( width, height )
Logo:SetImage( “logo.png” )
logo = true
end

if !button then
local Button1 = vgui.Create(“DButton”)
Button1:SetSize( width, height )
Button1:SetPos(x / 50, y / 50)
Button1:SetText("")

Button1.Paint = function(me,w,h)
	surface.SetDrawColor(Color(0,0,0,0))
	surface.DrawRect(0,0,w,h)
end

Button1.DoClick = function()
	gui.OpenURL( DonationLink )
end
button = true
end

end
MakeThem()

[/lua]

that doesn’t work

it just didnt work or are there errors?

did it and got this error


 Warning: vgui.Create failed to create the VGUI component (DImage)

[ERROR] lua/autorun/client/logoonhud.lua:11: attempt to index local 'Logo' (a nil value)
  1. LogoOnHud - lua/autorun/client/logoonhud.lua:11
   2. unknown - lua/autorun/client/logoonhud.lua:34

Default clips will be not be modified
--- Missing Vgui material texturemissing



It worked when I tested it, make sure you haven’t got an addon overriding DImage. ( http://i.imgur.com/o41Cm7L.png )