Well, UNIT_AURA fires when a unit's auras have changed. So when this fires, it sends you the unit that caused the event to fire. So you'd want to try something like this:
Lua Code:
textFrame:HookScript("OnEvent", function(self, event, ...) -- Use "HookScript" instead
if (event == "UNIT_AURA") then -- need to check to only run this code when the event fired is "UNIT_AURA"
local unit = select(1,...) -- UNIT_AURA returns one arg; being the unit
local count = 0
if (unit and unit ~= "player") then
return
end
-- Check player buffs against the roll the bones buffs
for buff in pairs(buffs) do
if UnitBuff("player", buff) then
count = count + 1
end
end
-- Give warning if need to reroll the bones
if UnitBuff("player", "True Bearing") or UnitBuff("player", "Shark Infested Waters") or count >= 2 then
textFrame:message("")
else
textFrame:message("ROLL THE BONES!!")
end
end
end)