View Single Post
09-28-10, 07:04 AM   #1
Lane
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 36
Lua help UnitDebuff

I'm trying to calculate the time remaining for a specific debuff. I'm not getting any errors but I think my lack of lua Math and Rounding is causing a nonsensical return.

Given:
Code:
local function getSpellTime(spell)
	local name, _, _, _, _, dur, exp, caster = UnitDebuff("target", spell)
	if name ~= nil and caster == "player" and name == spell then
		return exp - GetTime();
	end
end
My return value is usually something like 2... or 4...

Any idea what I need to get whole second times?