Quote Originally Posted by mjbz68 View Post
Just tried this one out - the script stayed executed and didn't kill itself this time when a slime was summoned, however, I received this error:

"Xenoscript Error:
Script: killiflowhealth.lua
Line #: 16
Error: Attempt to call method 'Pause' (a nil value)

Sorry for the noob questions - I am trying to self-educate on Lua as well by reading some guides so hopefully someday I can be more self-sufficient!
did it kill the mother when you had less then 80% health? Im not positive what spec meant to do with Pause() I think he meant Stop().
Code:
function getMother()
    for i = CREATURES_LOW, CREATURES_HIGH do
        local c = Creature.New(i)
        if c:Name() == "Slime" and c:HealthPercent() <= 75 then
            return c
        end
    end
end

local mother = getMother()
local me = Creature.GetByID(Self.ID())

Module.New('slime-trainer', function(module)
    if mother:isAlive() and me:HealthPercent() <= 80 then
        mother:Attack()
        module:Stop()
    end
end)