play_sound(4)
coroutine.resume(coroutine.create(play_sound),4)
If I replace Code: [Select]play_sound(4) in my script with Code: [Select]coroutine.resume(coroutine.create(play_sound),4) the camera doesn't beep, and there isn't any error. I'm new to lua, is there anything wrong with this coroutine usage?
bad argument #1 to 'create' (Lua function expected)
If there is no known use for it, maybe some bytes could be saved if You "ifdef" them out?
lib/lua/lbaselib.c line 515 ++ #ifdef HOST_LUAline 650 ++ #endif......LUALIB_API int luaopen_base (lua_State *L) { base_open(L);#ifdef HOST_LUA luaL_register(L, LUA_COLIBNAME, co_funcs);#endif return 2;}
co=coroutine.wrap(function() local xx = {1,2,3,4,5} while #xx > 0 do local x = table.remove(xx,1) local j for i=1,10000 do j = x*i end coroutine.yield(j) endend)t={}repeat x = co() table.insert(t,x)until not xreturn t
Started by mijulian General Chat
Started by kosmarnik General Discussion and Assistance
Started by oneaty « 1 2 » Completed and Working Scripts
Started by mrred Script Writing
Started by ChrisN LUA Scripting