Lua Code:
local h = { "hello", "bye" }
local function OnEvent(self, event, ...)
for key, val in ipairs(h) do
print(val)
end
-- prints:
-- hello
-- bye
-- or:
print(h[1]) -- prints hello
print(h[2]) -- prints bye
end
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
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.