Advertisement
Lenngotmelol

libby_dectalkttsthingy

Jul 25th, 2021 (edited)
1,386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.66 KB | None | 0 0
  1. -- hell yeah
  2. -- here is your working dectalk text to speech generator for gmod
  3. -- By lenn
  4.  
  5.  
  6. -- clientside version not serverside
  7.  
  8.  
  9. timer.Simple(5, function()
  10.  
  11. chat.AddText("[libby]: dectalk tts command and system loading")
  12.  
  13.  
  14. hook.Add("OnPlayerChat", "libre_textstospeech", function(v, text, team)
  15. if string.find(string.lower(text), "/tts") then
  16. if text[1] == "/" then
  17. local me = LocalPlayer()
  18. if v == me then
  19. print("received message")
  20.  
  21. -- translate people who say stuff in korean
  22.         chat.AddText("TTS (Text to speech) is enabled, you may disable it by typing /disabletts in chat")
  23. timer.Create("wtfmomentlaunch", 0.1, 1, function()
  24.  
  25.  
  26. hook.Add("OnPlayerChat","libre_woahtextspeech", function(player, text, team, dead)
  27.                   -- here u go your very nice dectalk text to speech generator
  28.                   -- not from porchlight
  29.     sound.PlayURL("http://tts.cyzon.us/tts?text="..text.."", "mono noblock noplay", function(station)
  30.  
  31. if ( IsValid( station ) ) then
  32.  
  33. ClientStation = station
  34. station:Play()
  35. station:SetVolume( 2.1 )
  36.  
  37. end
  38. end)
  39.  
  40.  
  41.  
  42. end)
  43.  
  44. end)
  45.  
  46.  
  47. else
  48.  
  49. end
  50. end
  51. end
  52. end)
  53.  
  54.  
  55.  
  56. hook.Add("OnPlayerChat", "libre_disabletextspeech", function(v, text, team)
  57. if string.find(string.lower(text), "/disabletts") then
  58. if text[1] == "/" then
  59. local me = LocalPlayer()
  60. if v == me then
  61. print("received message")
  62.  
  63.         chat.AddText("TTS (Text to speech) is disabled, you may enable it by typing /tts in chat again")
  64. timer.Create("wtfmomentlaunch", 0.1, 1, function()
  65. hook.Remove("OnPlayerChat","libre_woahtextspeech")
  66. end)
  67.  
  68.  
  69. else
  70.  
  71. end
  72. end
  73. end
  74. end)
  75.  
  76.  
  77. chat.AddText("[libby]: dectalk tts command and system loaded")
  78.  
  79. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement