So I have this code that makes a panel appear when you select a target:
LASTELY... I saw this code for when a party forms:
Lua Code:
In each Panel set the OnLoad script
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("PARTY_MEMBERS_CHANGED")
self:RegisterEvent("RAID_ROSTER_UPDATE")
Then in each Panel OnEvent script:
local pmems = GetNumPartyMembers()
local rmems = GetNumRaidMembers()
if (pmems < 1 and rmems < 1) or (pmems > 0 and pmems < 6 and rmems < 6) then
self:Hide()
else
self:Show()
end
I tried putting the top part in the OnLoad and the bottom part in the OnEvent window but nothing happened :/ Does this make it so the panel only shows up when you're in a party? If so, is there a way to make it so the panel only appears when, say, there's only 2 people, or 3 people, and so forth?
Any and all help is appreciated and thank you.
__________________________________
fixed everything below this line/
EDIT: I just realized I had this problem with the IN COMBAT Script:
Lua Code:
OnLoad
self:RegisterEvent("PLAYER_REGEN_DISABLED")
self:RegisterEvent("PLAYER_REGEN_ENABLED")
OnEvent
if event == "PLAYER_REGEN_ENABLED" then
self:Hide()
elseif event == "PLAYER_REGEN_DISABLED" then
self:Show()
end
It works fine after I reload UI, but every time I log in, the panel is there, even if im not in combat. After going into combat, though, it acts regularly and the panel disappears when not in combat. But only after reloading the ui or going into combat. It just bothers me logging in and having that panel active when its not supposed to.
Lua Code:
OnLoad
self:RegisterEvent("UNIT_TARGET")
self:Hide()
OnEvent
if UnitExists("target") == nil then
self:Hide()
return
end
local cl = UnitClassification("target")
if (cl == "elite") or (cl == "worldboss") or (cl == "rareeleite") then
self:SetBackdropColor(0.1, 0.1, 0.1, 0.1)
self:Show()
else
self:SetBackdropColor(1, 1, 1, 1)
self:Show()
end
Is there anyway someone could edit that for me so the panel appears ONLY when your target has a target selected?
ALSO
Is there a way to modify that code so the panel ONLY appears when you've selected a RARE mob with silver plate or an ELITE mob with golden plate?