Untitled
lua
24 days ago
1.3 kB
7
Indexable
Never
local config = { minPorcentaje = 90, segundos = 7, monstrarMsgs = true, storage = 53404, pos = {x=104, y=572, z=7}, monstros = {"Wolf", "Wolf", "Rat"}, messages = { "Hora de matar!", "Ha llegado tu hora...", "Pensaste que el iba a pelear solo?", "No dejaremos que mates a nuestro jefesito!", "Me gusta el pan con palta!", }, } local isRunning = {} local function crearMonster(monsterCID) for i = 1, #config.monstros do monstruo = doCreateMonster(config.monstros[i], getCreaturePosition(monsterCID)) doSendMagicEffect(getCreaturePosition(monstruo), CONST_ME_TELEPORT) doCreatureSay(monstruo, config.messages[math.random(1, #config.messages)], TALKTYPE_SAY) end if config.monstrarMsgs then print("Recibiendo addEvent...") end end function onStatsChange(cid, attacker, type, combat, value) if isMonster(cid) and isPlayer(attacker) then local hpPorcentaje = (getCreatureHealth(cid)/getCreatureMaxHealth(cid))*100 if hpPorcentaje < config.minPorcentaje and not isRunning[cid] then if config.monstrarMsgs then print("Enviando addEvent...") end isRunning[cid] = true doCreatureSay(cid, "No eres rival para mi!", TALKTYPE_ORANGE_2) addEvent(crearMonster, config.segundos, cid) end end return true end