Lua Code:
local f=CreateFrame("frame")
f:RegisterEvent("GROUP_ROSTER_UPDATE")
f:SetScript("OnEvent",function()
if UnitName("party3") then
eBar_bar_4:SetAlpha(0)
eBar_bar_5:SetAlpha(0)
eBar_bar_6:SetAlpha(0)
eBar_bar_7:SetAlpha(0)
LoseControlparty1:SetAlpha(0)
LoseControlparty2:SetAlpha(0)
else
eBar_bar_4:SetAlpha(1)
eBar_bar_5:SetAlpha(1)
eBar_bar_6:SetAlpha(1)
eBar_bar_7:SetAlpha(1)
LoseControlparty1:SetAlpha(1)
LoseControlparty2:SetAlpha(1)
end
end
Assuming you made the addon correctly, that code by itself only runs once when the UI loads. You need to have it run every time your group changes, so you create a frame, register it for the group change event, and then set the code to run with the OnEvent frame script. If you are unsure if you made the addon correctly, you can go to
https://addon.bool.no to easily make it with this code.
Also, "GetPartyMember" doesn't exist, not sure where you got that, so we'll use UnitName here to check if party3 exists. Keep in mind that in a party, not a raid, a full group of players will be you with the unit "player", then the other four members as "party1", "party2", "party3", and "party4". This code is checking if the party has a fourth member. In a raid, "player" still exists, but you will also have a "raid#" unit with no guarantee which number.