Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. local sounds = {}
  2. taunt_delay = 10
  3. print("loaded")
  4. for k, v in pairs(file.Find("sounds/taunts/*.wav",true)) do
  5.     local replace = string.Replace(v, ".wav", "")
  6.     table.insert(sounds, replace)
  7.     resource.AddFile(string.Replace(v, ".wav", ""))
  8.     print("Sound Added: "..string.Replace(v, ".wav", ""))
  9. end
  10.  
  11.  
  12.  
  13. function Taunt(ply)
  14. ply.Lasttt = 0
  15. if taunt_delay + ply.Lasttt <= CurTime() then
  16.     repeat
  17.         rt = table.Random(sounds)
  18.     until rt != ply.Lastt
  19.     ply.Lasttt = CurTime()
  20.     ply.Lastt = rt
  21.     ply:EmitSound(rt, 100)
  22. else
  23.     print("Needs Time to recharge!")
  24. end
  25.  
  26.  
  27. end
  28. hook.Add("ShowSpare1", "Taunts", Taunt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement