View Single Post
12-29-20, 07:35 AM   #2
gnulk
A Defias Bandit
Join Date: Dec 2020
Posts: 2
Solved

So i figured it out, here is the snippet using 3 events.



Lua Code:
  1. -- A player has requested to duel me
  2. function Duelist:DUEL_REQUESTED(event, playerName)
  3.     opponentName = playerName
  4.     duelingOn = true
  5.  end
  6.  
  7.  --I requested a duel to my target
  8.  function Duelist:CHAT_MSG_SYSTEM(event, text)
  9.     if string.find(text, _G.ERR_DUEL_REQUESTED ) then
  10.         if (UnitExists("target")) then
  11.             duelingOn = true
  12.             opponentName = UnitName("target")
  13.         end
  14.     end
  15.  end
  16.  
  17.   -- The duel finished or was canceled
  18.   function Duelist:DUEL_FINISHED(event)
  19.     opponentName = ""
  20.     duelingOn = false
  21.   end
  Reply With Quote