I've just started learning to make wow addons. I haven't learned lua much yet but I am trying to make one now. and I can make a simple thing that check whether I get into combat or leave combat like following.
local f = CreateFram("Frame")
f:RegisterEvent("PLAYER_REGEN_DISABLED")
f:RegisterEvent("PLAYER_REGEN_ENABLED")
f:SetScript("OnEvent", function(self, event, ...)
if event == "PLAYER_REGEN_DISABLED" then
print("You are in combat")
end
if event == "PLAYER_REGEN_ENABLED" then
print("You've left combat")
end
end)
My question is "How do you do this on someone else"? I'd like to check enemy players in battleground whether anyone of them left combat during the game. How do you get event from enemy players?