Happy99

Cake pls fix

Jul 3rd, 2015
126
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local h = {
  2.     hooks = {},
  3. };
  4.  
  5. local null = function() end
  6.  
  7. function h.detour(typ)
  8.     h.hooks[typ] = {};
  9.  
  10.     local ofunc = GAMEMODE[typ] || null;
  11.  
  12.     GAMEMODE[typ] = function(self, ...)
  13.  
  14.         ofunc(self, ...);
  15.  
  16.         for k,v in next, h.hooks[typ] do
  17.             local ret1, ret2, ret3, ret4 = v(...);
  18.             if(ret1) then return ret1, ret2, ret3, ret4; end
  19.         end
  20.  
  21.     end
  22. end
  23.  
  24. function h.Add(typ, func)
  25.     if(!h.hooks[typ]) then
  26.         h.detour(typ);
  27.     end
  28.  
  29.     h.hooks[typ][ #h.hooks[typ] + 1 ] = func;
  30. end
  31.  
  32. h.Add("HUDPaint", function()
  33.         for k,v in pairs ( player.GetAll() ) do
  34.  
  35.             local Position = ( v:GetPos() + Vector( 0,0,80 ) ):ToScreen()
  36.             local Name = ""
  37.             local Health = v:Health()
  38.      
  39.             if v == LocalPlayer() then Name = "" else Name = v:Name() end
  40.             if Health < 0 || Health == 0 then Health = "Dead" end
  41.             draw.DrawText( Name, "Default", Position.x, Position.y, Color( 255, 255, 255, 255 ), 1 )
  42.             draw.DrawText( Health, "Default", Position.x, Position.y + 10, Color( 0, 255, 0, 255 ), 1 )
  43.         end
  44. end)
RAW Paste Data