Lua Code:
textFrame:RegisterEvent("UNIT_AURA")
textFrame:RegisterEvent("PLAYER_REGEN_DISABLED")
textFrame:RegisterEvent("PLAYER_REGEN_ENABLED")
textFrame:SetScript("OnEvent", function(self, event, ...)
local combatcheck = "false"
local count = 0
if event=="PLAYER_REGEN_DISABLED" then
combatcheck = true -- change to boolean
elseif event =="PLAYER_REGEN_ENABLED" then
combatcheck = false -- change to boolean
end
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 not combatcheck then -- same thing as cooldown == false
textFrame:message("")
elseif combatcheck and (UnitBuff("player", "True Bearing") or UnitBuff("player", "Shark Infested Waters") or count >= 2) then
textFrame:message("")
else
textFrame:message("REROLL THE BONES!!".." "..tostring(combatcheck)) -- need to convert booldean to string to concatenate
end
end)
Made changes to lines 10, 12, 27, and 29.
In the last elseif (line 29), try encapsulating the "or" conditions within brackets.