View Single Post
08-31-12, 11:12 AM   #359
Shanyn
A Deviate Faerie Dragon
Join Date: Nov 2009
Posts: 16
I am trying to play with custom triggers over here, and I know just enough to be dangerous but not quite enough to get things working the way I'd like. The idea is to display an aura if the time left on my Corruption is less than 6 seconds.

I have a custom trigger set to listen to UNIT_AURA, and my trigger code is as follows:

Code:
-- Trigger constructor arguments.
-- @param class  The trigger class.
local class = ...;

-- Any pre-trigger setup here. Locals 
-- defined here are upvalues to the
-- generated function.
local _,_,_,_,_,timeleft = UnitDebuff("target","Corruption","PLAYER");

-- Generate trigger function.
return function(self, buffer, action, store)
    return (timeleft < 6);
end
However I'm getting a ton of "attempt to compare nil with number" errors as soon as I set any display to be bound to this custom trigger. I don't know enough about lua to diagnose what I did wrong. Could I get some help?

Thanks in advance.

Last edited by Shanyn : 08-31-12 at 11:15 AM.