That code is incomplete, as you didn't actually tell the frame what to do in response to events. Also:
- There's no need to use separate functions for the two events, as you want to do the same thing in response to both.
- You should use RegisterUnitEvent instead of RegisterEvent with UNIT_STATS so you don't have to manually filter out all other units.
- If your frame isn't a UI object shown the user, there's no need to give it a parent.
- A frame is already a table, so there's no need to create a separate table to hold functions.
Code:
-- updateFunction here
local frame = CreateFrame("Frame")
-- ^ If you already have a frame, you can register events on that instead of creating a new one here.
frame:RegisterEvent("COMBAT_RATING_UPDATE")
frame:RegisterUnitEvent("UNIT_STATS", "player")
frame:SetScript("OnEvent", updateFunction)
(On a side note, I really hope those "AgilityLine" etc. values are not globals.
)