View Single Post
03-13-18, 05:02 PM   #7
WhirlyTV
A Murloc Raider
Join Date: Mar 2018
Posts: 6
Originally Posted by Eungavi View Post
Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:RegisterEvent("PLAYER_UPDATE_RESTING")
  3. f:SetScript("OnEvent", function(self, event, ...)
  4.     if IsResting() then
  5.         -- You are now resting. Play some music!
  6.         -- PlayMusic
  7.     else
  8.         -- You are no longer resting. Turn off the music :(
  9.         -- StopMusic
  10.     end
  11. 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.
  Reply With Quote