Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if SERVER then return end
- local lerp = 0
- local pos = ScrH() / 2 + 50
- local pos2 = ScrH() * 2
- local x = ScrW()/2 - 100
- local frame = vgui.Create("DFrame")
- frame:SetSize(200,100)
- frame:MakePopup()
- frame:SetPos(0,pos2)
- frame.Paint = function(self, w, h)
- surface.SetDrawColor(0,255,255)
- surface.DrawRect(0,0,w, h)
- if lerp != 1 then
- local _,y = self:GetPos()
- self:SetPos(x, Lerp(lerp, y, pos) )
- lerp = math.Clamp(lerp + 0.01, 0, 1)
- end
- end
- local but = vgui.Create("DButton", frame)
- Stage 1, moving derma
- local x,y = 50, ScrH() - 200
- local pl = LocalPlayer()
- hook.Add("HUDPaint", "tutorial hud",function()
- surface.SetDrawColor(255,0,0)
- surface.DrawRect(x,y,math.Clamp(500 * ( pl:Health() / pl:GetMaxHealth() ), 0, 500 ), 20)
- surface.SetDrawColor(0,0,0)
- surface.DrawOutlinedRect(x, y, 500, 20 )
- draw.SimpleText( pl:Health() .. "%", "DermaDefault", x + 5, y + 10, Color(255,255,255) ,0, 1)
- end)
- Simple HUD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement