Rayeko
Programmer
- Joined
- Apr 9, 2008
- Messages
- 185
- Reaction score
- 3
Hi.
The reason I made this topic is because I wanna know how can I use the "wait" system the TFS 0.3.6 has? I tried using like: wait(3000) for 3 seconds, but I get this error:
This is the code I have in the lib folder:
I would appreciate if somebody knows something about this..
The reason I made this topic is because I wanna know how can I use the "wait" system the TFS 0.3.6 has? I tried using like: wait(3000) for 3 seconds, but I get this error:
Code:
[22/03/2010 22:06:35] [Error - TalkAction Interface]
[22/03/2010 22:06:35] data/talkactions/scripts/stats/charge.lua:onSay
[22/03/2010 22:06:35] Description:
[22/03/2010 22:06:35] attempt to yield across metamethod/C-call boundary
[22/03/2010 22:06:35] stack traceback:
[22/03/2010 22:06:35] [C]: in function 'wait'
[22/03/2010 22:06:35] data/talkactions/scripts/stats/charge.lua:17: in function <data/talkactions/scripts/stats/charge.lua:1>
This is the code I have in the lib folder:
Code:
wait = coroutine.yield
function runThread(co)
if(coroutine.status(co) ~= 'dead') then
local _, delay = coroutine.resume(co)
addEvent(continueThread, delay, co)
end
end
function createThread(data)
local dataType, func = type(data), nil
if(dataType == 'string') then
func = loadstring(data)
elseif(dataType == 'function') then
func = data
end
if(func ~= nil) then
local co = coroutine.create(func)
runThread(co)
else
print("[createThread]", "Invalid data specified.")
end
end
I would appreciate if somebody knows something about this..