Advertisement
Guest User

Auto Dead Give

a guest
Apr 24th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. --Notes
  2. --getID gets innocents and detectives
  3. --autodeadgive runs getID till there is either 1 D or 1 I alive
  4. --Never tested, may need to be edited a bit :D
  5. --Notes
  6.  
  7. local function getID()
  8. if (SERVER) then
  9. local ICount = 0
  10. local DCount = 0
  11. for k, v in pairs( player.GetAll() ) do
  12. if v:IsInnocent() and v:Alive() then
  13. ICount=ICount+1
  14. elseif v:IsDetective() and v:Alive() then
  15. DCount=DCount+1
  16. end
  17. end
  18. end
  19.  
  20.  
  21.  
  22. local function autodeadgive()
  23.     while true do
  24.         getID()
  25.         if ICount or DCount = 1 then
  26.         ulx playsound deadgive.mp3
  27.         end
  28.     end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement