View Single Post
11-08-20, 07:03 AM   #6
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Lua Code:
  1. local h = { "hello", "bye" }
  2.  
  3. local function OnEvent(self, event, ...)
  4.     for key, val in ipairs(h) do
  5.         print(val)
  6.     end
  7.     -- prints:
  8.     -- hello
  9.     -- bye
  10.     -- or:
  11.     print(h[1]) -- prints hello
  12.     print(h[2]) -- prints bye
  13. end
  14.  
  15. local f = CreateFrame("Frame")
  16. f:RegisterEvent("PLAYER_ENTERING_WORLD")
  17. f:SetScript("OnEvent", OnEvent)

That will print hello and bye in your chat frame but only you will be able to see it. If you want to broadcast a message to others in the game like a /say, you would need to use SendChatMessage instead of print.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 11-08-20 at 02:01 PM.
  Reply With Quote