Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. -- CONFIG --
  2.  
  3. -- The watermark text --
  4. servername = "ViceRP Official"
  5.  
  6. -- The x and y offset (starting at the top left corner) --
  7. -- Default: 0.005, 0.001
  8. offset = {x = 0.005, y = 0.001}
  9.  
  10. -- Text RGB Color --
  11. -- Default: 64, 64, 64 (gray)
  12. rgb = {r = 250, g = 126, b = 0}
  13.  
  14. -- Text transparency --
  15. -- Default: 255
  16. alpha = 255
  17.  
  18. -- Text scale
  19. -- Default: 0.4
  20. -- NOTE: Number needs to be a float (so instead of 1 do 1.0)
  21. scale = 0.4
  22.  
  23. -- Text Font --
  24. -- 0 - 5 possible
  25. -- Default: 1
  26. font = 1
  27.  
  28. -- Rainbow Text --
  29. -- false: Turn off
  30. -- true: Activate rainbow text (overrides color)
  31. bringontherainbows = false
  32.  
  33. -- CODE --
  34. Citizen.CreateThread(function()
  35. while true do
  36. Wait(1)
  37.  
  38. if bringontherainbows then
  39. rgb = RGBRainbow(1)
  40. end
  41. SetTextColour(rgb.r, rgb.g, rgb.b, alpha)
  42.  
  43. SetTextFont(font)
  44. SetTextScale(scale, scale)
  45. SetTextWrap(0.0, 1.0)
  46. SetTextCentre(false)
  47. SetTextDropshadow(2, 2, 0, 0, 0)
  48. SetTextEdge(1, 0, 0, 0, 205)
  49. SetTextEntry("STRING")
  50. AddTextComponentString(servername)
  51. DrawText(offset.x, offset.y)
  52. end
  53. end)
  54.  
  55. -- By ash
  56. function RGBRainbow(frequency)
  57. local result = {}
  58. local curtime = GetGameTimer() / 1000
  59.  
  60. result.r = math.floor(math.sin(curtime * frequency + 0) * 127 + 128)
  61. result.g = math.floor(math.sin(curtime * frequency + 2) * 127 + 128)
  62. result.b = math.floor(math.sin(curtime * frequency + 4) * 127 + 128)
  63.  
  64. return result
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement