I've been working on an addon for a couple months now and have gotten it setup for the most part to do what I want. However I was wondering if there would be a way to make it detect if a person isn't in a guild to put the message into say or general chat.
I was thinking there should be a simple way to make it happen using the IsInGuild() piece and having an else in there.Code:local ml; function LevelUp_OnLoad() LevelUp:RegisterEvent("PLAYER_LEVEL_UP"); local ourRace = UnitRace("player"); if (ourRace == "Human" or ourRace == "Dwarf" or ourRace == "Gnome" or ourRace == "Night Elf" or ourRace == "Draenei" or ourRace == "Worgen") then ml = "Common"; else ml = "Orcish"; end SLASH_LEVELUP1 = "/levelup"; SlashCmdList["LEVELUP"] = function(msg) LevelUp_SlashCommandHandler(msg); end end -- This is the chat message sent when you enter the test slash command /levelup function LevelUp_SlashCommandHandler(msg) -- arg1 = UnitLevel("player"); SendChatMessage("Ding Dong! The Witch is dead. Which old Witch? The Wicked Witch! Ding Dong! The Wicked Witch is dead.", "GUILD", ml, ""); PlaySoundFile("Interface\\AddOns\\LevelUp\\LevelUp.mp3") end -- This is the Chat output send upon the event your character levels function LevelUp_OnEvent(event) if ( (event == "PLAYER_LEVEL_UP") ) then SendChatMessage("Ding Dong! The Witch is dead. Which old Witch? The Wicked Witch! Ding Dong! The Wicked Witch is dead.", "GUILD", ml, ""); PlaySoundFile("Interface\\AddOns\\LevelUp\\LevelUp.mp3") end