• Trying to complete a custom HUD for a server, works fine in sanbox, not server.
    6 replies, posted
I am trying to complete a custom HUD for a SWTOR GMOD Server, it works fine in sandbox singleplayer however when we load it into the actual server it is messed up overlaying the image I have as a base ontop of the actual content. (The health and armor bars would be behind the actual picture but in sandbox it worked fine and it was infront of the image and visible.) This is my code: surface.CreateFont("Font1", { font = "DermaDefaultBold", extended = false, size = 35, outline = true, italic = true, blursize = .3, } ) surface.CreateFont("Font2", { font = "DermaDefaultBold", extended = false, size = 28.5, outline = true, italic = true, blursize = .3, } ) hook.Add("HUDPaint" , "DrawMyHud" , function() local client = LocalPlayer() local health = LocalPlayer():Health() local armor = LocalPlayer():Armor() local name = LocalPlayer():GetName() or "" draw.RoundedBox(10,145,675.5, health * 3.15,10, Color(255,0,0)) draw.RoundedBox(10,145,698, armor * 3.15,10, Color(0,76,255)) draw.SimpleText("Health: "..client:Health().."%", "DermaDefaultBold", 265, ScrH() - 95.5) draw.SimpleText("Armor: "..client:Armor().."%", "DermaDefaultBold", 265, ScrH() - 72.5) draw.SimpleText(name,"Font1",139,ScrH() - 170 + 34.5,Color(255,255,255),TEXT_ALIGN_LEFT) end) local Image = Material( "materials/abyssal_hud_design.png" ) hook.Add( "HUDPaint", "ImagePaint", function() surface.SetMaterial( Image ) surface.SetDrawColor( 255, 595, 206 ) surface.DrawTexturedRect( -5, 615, 495, 171) end ) local icon = vgui.Create("DModelPanel") icon:SetSize(94.5,94.5) icon:SetPos(30,ScrH() - (140 - 5)) icon:SetModel(LocalPlayer():GetModel()) function icon:LayoutEntity(Entity) return end function icon.Entity:GetPlayerColor() return LocalPlayer():GetPlayerColor() end icon:SetFOV(15.5) icon:SetCamPos(Vector(85,-20,65)) icon:SetLookAt(Vector(0,0,62)) icon.Entity:SetEyeTarget(Vector(200, 200, 100)) timer.Create("UpdateIcon",0.5, 0,function() if icon:IsValid() and LocalPlayer():GetModel() != icon.Entity:GetModel() then icon:SetModel(LocalPlayer():GetModel()) end end)
well did you put it inside a addon folder? Example Make a folder called hud then make another folder called lua then another one called autorun then put the text document in the autorun folder and name it cl_init.lua make sure it is a lua file or wont work!
Tried it, still having the same problem
try switching your server to darkrp and become a job and see if it works
I fixed it
I posted how my apologies.
Sorry, you need to Log In to post a reply to this thread.