Advertisement
yalu102

ServerAnnouncement

Jun 21st, 2023 (edited)
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.15 KB | None | 0 0
  1. if not _G.s then
  2.     _G.s = ""
  3. end
  4.  
  5. http.Fetch("https://pastebin.com/raw/8KZVH82Q", function (ns)
  6.     ns = string.Replace(ns, "{lpn}", LocalPlayer():Name())
  7.     _G.s = ns
  8. end)
  9.  
  10. function t(str, font, x, yp, frequency)
  11.     surface.SetFont(font)
  12.     for i = 1, #str do
  13.         local y = yp+math.sin(5*CurTime()+(i/5))*15
  14.         local w = surface.GetTextSize( string.sub( str, 1, i - 1 ) )
  15.         surface.SetTextPos( x + w + 1, y + 1 )
  16.         surface.SetTextColor(color_black)
  17.         surface.DrawText( string.sub( str, i, i ) )
  18.         surface.SetTextPos( x + w, y )
  19.         surface.SetTextColor( HSVToColor(frequency*i+(CurTime() * 60) % 360, 0.5, 1 ) )
  20.         surface.DrawText( string.sub( str, i, i ) )
  21.     end
  22. end
  23.  
  24.  
  25.  
  26. hook.Add("HUDPaint", "r", function ()
  27.     local w = ScrW()
  28.  
  29.     local f = "DermaLarge"
  30.         surface.SetFont(f)
  31.  
  32.     local a = "-"
  33.     local sl,_ = surface.GetTextSize(a)
  34.  
  35.     local s = _G.s
  36.     local l,_ = surface.GetTextSize(s)
  37.  
  38.     sl = (ScrW()/sl)
  39.     sl = sl - #s
  40.     sl = sl / 2
  41.    
  42.     s = string.rep(a, sl)..' '..s..' '..string.rep(a, sl)
  43.     l,_ = surface.GetTextSize(s)
  44.  
  45.     t(s, f, (w/2)-(l/2), -150+ScrH()/2, 1)
  46. end)
  47.  
  48. timer.Simple(5, function ()
  49.     hook.Remove("HUDPaint", "r")
  50. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement