#Who targeting me?
12 messages · Page 1 of 1 (latest)
you need code for that
on FRAME_UPDATE, throttled to whatever, you iterate over all nameplates and check if their target is you
when you have any unit Id, then appending target is a reference to the unit they're targeting
so nameplate4target is what nameplate 4 is targeting
so e.g.
for i = 1, 40 do
local unit = "nameplate" .. i
if UnitIsUnit(unit .. "target", "player") then
-- do something
end
end
-- do something could be creating one state per unit targeting you. set unit = unit and then you can use %unit formatting for %unit in the display tab and it gives you the char name with class colouring etc.
!tsu
Trigger State Updater is an advanced custom trigger type that allows for the creation of clones, as well as generally being a very flexible custom trigger for almost all situations. While it is complex, the wiki aims to be thorough so please do use it.
https://github.com/WeakAuras/WeakAuras2/wiki/Trigger-State-Updater-(TSU)/
(that requires you to enable friendly nameplates)