Originally Posted by Eungavi
Lua Code:
local f = CreateFrame("Frame") f:RegisterEvent("PLAYER_UPDATE_RESTING") f:SetScript("OnEvent", function(self, event, ...) if IsResting() then -- You are now resting. Play some music! -- PlayMusic else -- You are no longer resting. Turn off the music :( -- StopMusic end end)
You might want to use PlayMusic and StopMusic function, but cannot 100% guarantee.
|
Thank you so much for the help, I really appreciate it. I'm not a competent programmer unfortunately so I have no idea where to begin to make this happen. Is there also a way to tell when your character opens up a vendor? I'm currently watching youtube tutorials to try and learn how to create this.