As Thakka5 stated this is posted in the wrong section, please ask future questions in Ask a Pro.
Now the problem, the problem is that you only resume the coroutines once. The os.pullEvent is a wrapper for coroutine.yield, so you must resume the coroutines. Also your loop that "manages" the routines does not yield itself, so would also crash the program with a failure to yield.
A solution (only relevant code shown)
function process()
local c1 = coroutine.create(chatreceive)
local c2 = coroutine.create(terminal)
local eventData = {}
while true do
--# resume our routine giving it the event data
coroutine.resume(c1, unpack(eventData))
if coroutine.status(c1) == "dead" then
c1 = coroutine.create(chatreceive)
end
--# resume our routine giving it the event data
coroutine.resume(c2, unpack(eventData))
if coroutine.status(c2) == "dead" then
c2 = coroutine.create(terminal)
end
eventData = { coroutine.yield() } --# you could also use os.pullEventRaw here, but again, it is just a wrapper of coroutine.yield, so why not just use the top level function
end
end
EDIT: Also it should be noted that if the read coroutine dies the screen will not be cleared, and the new coroutine does not remember the input from the old one.
Ehm… firstly, this is the wrong section, and also:
local data = "hello"
print("" ..data)
or
local data = "hello"
print("hello")
Ummm what? o.O