w9s66v09c8x5o1fl3p0

Rifbot Creature Attack Alarm

Jan 11th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. --[[
  2.     Script Name:        Creature Attack
  3.     Description:        Play sound if any monster or player attack you.
  4.     Author:             Ascer - example
  5. ]]
  6.  
  7. local SAFE_LIST = {"Defense Monster", "Friend2"} -- add here your training friend or defense monster for example. Names need to by with Capital letter.
  8.  
  9. Module.New("Creature Attack", function (mod)
  10.     for i, mob in pairs(Creature.getCreatures()) do
  11.         if not table.find(SAFE_LIST, mob.name) then
  12.             if mob.attack == 1 then
  13.                 Rifbot.PlaySound("Player Attack.mp3") -- for more search in Rifbot Lib.lua -> RIFBOT_SOUNDS = []
  14.                 break -- break loop
  15.             end
  16.         end
  17.     end            
  18.     mod:Delay(200)
  19. end)
Add Comment
Please, Sign In to add comment