View Single Post
02-02-08, 01:04 PM   #17
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by Stonedpossum View Post
Gah! Ok, I have,

Code:
local frame= CreateFrame("Frame")
frame:RegisterEvent("PLAYER_AURAS_CHANGED")
frame:SetScript("OnEvent", function(frame)
    local t = 0
    frame:SetScript("OnUpdate", function(_, elapsed)
        t = t + elapsed
        if t >= 1 then
            frame:SetScript("OnUpdate", nil) 
            if IsMounted() then
                PlayMusic("Interface\\AddOns\\OnTheRoad\\music.mp3")
            else  
                StopMusic()
            end
        end
end)
But it still doesn't even work.

put
Code:
DEFAULT_CHAT_FRAME:AddMessage("Stopping music")
after StopMusic() to find out if its IsMounted() and
Code:
DEFAULT_CHAT_FRAME:AddMessage("Playing music")
after PlayMusic() then try mounting up. If you see Playing music printed then it means PlayMusic() is failing else its IsMounted try playing around with the value in
Code:
t >= 1
.

Is Music enabled, in the sound options? And does <Your addon> appear in the addon list?
  Reply With Quote