• 0

    posted a message on [PitBull] Sound when shifting target is gone
    Quote from Phanx »

    TargetSound.toc
    ## Interface: 20300
    ## Title: TargetSound
    ## Notes: Plays a sound upon gaining or losing target.
    TargetSound.lua


    TargetSound.lua
    local f = CreateFrame("Frame")
    f:RegisterEvent("PLAYER_TARGET_CHANGED")
    f:SetScript("OnEvent", function()
    	if UnitExists("target") then
    		if UnitIsEnemy("target", "player") then
    			PlaySound("igCreatureAggroSelect")
    		elseif UnitIsFriend("player", "target") then
    			PlaySound("igCharacterNPCSelect")
    		else
    			PlaySound("igCreatureNeutralSelect")
    		end
    	else
    		PlaySound("INTERFACESOUND_LOSTTARGETUNIT")
    	end
    end)


    Will work with any and all unitframe addons (or even with no unit frames at all), and won't require you to edit addon files every time the addon is updated.



    Where would I put these 2 Files once created? I dropped them right insde the Pitbull folder, but I still dont have any sounds while switching targets. Thanks for the help!
    Posted in: Unit Frames
  • To post a comment, please or register a new account.