Originally Posted by WhirlyTV
-- This file is loaded from "ZeldaShop.toc"
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_UPDATE_RESTING")
f:RegisterEvent("MERCHANT_SHOW")
f:RegisterEvent("MERCHANT_CLOSED")
f:SetScript("OnEvent", function(self, event, ...)
if event == "PLAYER_UPDATE_RESTING" then
if IsResting() then
PlayMusic("C:\Program Files (x86)\World of Warcraft\Interface\AddOns\ZeldaShop")
else
StopMusic()
end
elseif event == "MERCHANT_SHOW" then
PlayMusic(C:\Program Files (x86)\World of Warcraft\Interface\AddOns\ZeldaShop)
elseif event == "MERCHANT_CLOSED" then
StopMusic()
end
end)
I placed the Zeldashop.mp3 into the Addon folder and set the path to it.
|
I meant your addon's folder, not Interface\AddOns
+ IIrc, the upper most folder of each addon is their own folders.
So, if you have an addon called ZeldaShop and got a sound file called ZeldaShop.mp3 in that addon folder then it'd be something like this.
Lua Code:
PlayMusic("ZeldaShop.mp3")
Seems, I'm wrong.
Follow semlar's comment