Advertisement
NonSequitur

Untitled

Apr 29th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. --[[
  2. <talkaction words="/mute" separator=" " script="mute.lua" />
  3. ]]
  4.  
  5. local config = {
  6. whitelist = {
  7. 'rotanev', 'nonseq'
  8. },
  9.  
  10. time = 1, -- tempo em minutos
  11. }
  12.  
  13. local muted = Condition(CONDITION_MUTED)
  14. muted:setParameter(CONDITION_PARAM_TICKS, config.time * 60 * 1000)
  15.  
  16. function onSay(player, words, param)
  17. local found = false
  18. for _, name in ipairs(config.whitelist) do
  19. if player:getName():lower() == name:lower() then
  20. found = true
  21. break
  22. end
  23. end
  24.  
  25. if not found then
  26. return false
  27. end
  28.  
  29. local target = Player(param)
  30. if not target then
  31. player:sendTextMessage(MESSAGE_STATUS_WARNING, "Player not found.")
  32. else
  33. target:addCondition(muted)
  34. end
  35.  
  36. return true
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement