Страница 1 из 1

Не работает remain lua в хпале

Добавлено: 12 май 2026, 12:40
Blizzmen
Не работает нормально remain, никак не хочется запоминать время до окончания каста, нада хелп
local remain = 999

if UnitIsUnit(ForeachUnit, "player") and UnitExists("target") and UnitCanAttack("player", "target") then
local _, _, _, _, endTimeEnemy = UnitCastingInfo("target")
if not endTimeEnemy then
_, _, _, _, endTimeEnemy = UnitChannelInfo("target")
end
if endTimeEnemy then
remain = (endTimeEnemy / 1000) - GetTime()
end
end

if remain > 1.5 then
local _, _, _, _, endTime = UnitCastingInfo(ForeachUnit)
local _, _, _, _, channelEnd = UnitChannelInfo(ForeachUnit)

if endTime then
remain = (endTime / 1000) - GetTime()
elseif channelEnd then
remain = (channelEnd / 1000) - GetTime()
end
end

if remain <= 1.10 then
if MyReadyForCast(2, ForeachUnit, 48782, true) then
return 48782, ForeachUnit, nil
end
end