Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sounds = {}
- taunt_delay = 10
- print("loaded")
- for k, v in pairs(file.Find("sounds/taunts/*.wav",true)) do
- local replace = string.Replace(v, ".wav", "")
- table.insert(sounds, replace)
- resource.AddFile(string.Replace(v, ".wav", ""))
- print("Sound Added: "..string.Replace(v, ".wav", ""))
- end
- function Taunt(ply)
- ply.Lasttt = 0
- if taunt_delay + ply.Lasttt <= CurTime() then
- repeat
- rt = table.Random(sounds)
- until rt != ply.Lastt
- ply.Lasttt = CurTime()
- ply.Lastt = rt
- ply:EmitSound(rt, 100)
- else
- print("Needs Time to recharge!")
- end
- end
- hook.Add("ShowSpare1", "Taunts", Taunt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement