Originally Posted by Kanegasi
Lua Code:
local guildie={} local f=CreateFrame("frame") f:RegisterEvent("GUILD_ROSTER_UPDATE") f:RegisterEvent("NAME_PLATE_UNIT_ADDED") f:SetScript("OnEvent",function(self,event,unit) if event=="GUILD_ROSTER_UPDATE" then local total=GetNumGuildMembers() wipe(guildie) for i=1,total do local guid=select(17,GetGuildRosterInfo(i)) if guid then guildie[guid]=true end end elseif event=="NAME_PLATE_UNIT_ADDED" then if guildie[UnitGUID(unit))] then -- here's where the check happens -- you can either do something with the nameplate -- using C_NamePlate.GetNamePlateForUnit(unit) to get the frame -- or something simple like play a sound to announce the guildie end end end)
|
So after
if guildie[UnitGUID(unit))] then if I just write
Playsound(888) will it work? Or do I have to write something else? I'm still a bit confused x)
if guildie[UnitGUID(unit))] then
Playsound(888)
end
end
end)
|