Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. local Keys = {
  2. ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
  3. ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
  4. ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
  5. ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
  6. ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
  7. ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
  8. ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
  9. ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
  10. ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
  11. }
  12.  
  13. local voice = {default = 12.0, shout = 40.0, whisper = 1.0, current = 0, level = nil}
  14.  
  15. AddEventHandler('onClientMapStart', function()
  16. if voice.current == 0 then
  17. NetworkSetTalkerProximity(voice.default)
  18. SendNUIMessage({
  19. heal = 52
  20. });
  21. elseif voice.current == 1 then
  22. NetworkSetTalkerProximity(voice.shout)
  23. SendNUIMessage({
  24. heal = 100
  25. });
  26. elseif voice.current == 2 then
  27. NetworkSetTalkerProximity(voice.whisper)
  28. SendNUIMessage({
  29. heal = 25
  30. });
  31. end
  32. end)
  33.  
  34. Citizen.CreateThread(function()
  35. while true do
  36. Citizen.Wait(1)
  37.  
  38. if IsControlJustPressed(1, 166) then
  39. voice.current = (voice.current + 1) % 3
  40. if voice.current == 0 then
  41. NetworkSetTalkerProximity(voice.default)
  42. SendNUIMessage({
  43. heal = 52
  44. });
  45. elseif voice.current == 1 then
  46. NetworkSetTalkerProximity(voice.shout)
  47. NetworkSetTalkerProximity(voice.shout)
  48. SendNUIMessage({
  49. heal = 100
  50. });
  51. elseif voice.current == 2 then
  52. NetworkSetTalkerProximity(voice.whisper)
  53. SendNUIMessage({
  54. heal = 25
  55. });
  56. end
  57. end
  58.  
  59. if voice.current == 0 then
  60. SendNUIMessage({
  61. heal = 52
  62. });
  63. elseif voice.current == 1 then
  64. SendNUIMessage({
  65. heal = 100
  66. });
  67. elseif voice.current == 2 then
  68. SendNUIMessage({
  69. heal = 25
  70. });
  71. end
  72. if NetworkIsPlayerTalking(PlayerId()) then
  73. SendNUIMessage({talking = true})
  74.  
  75. elseif not NetworkIsPlayerTalking(PlayerId()) then
  76. SendNUIMessage({talking = false})
  77. end
  78. end
  79. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement