diff --git a/src/editor/engine/GameRuntime.js b/src/editor/engine/GameRuntime.js index 0bf3b6e..99072d9 100644 --- a/src/editor/engine/GameRuntime.js +++ b/src/editor/engine/GameRuntime.js @@ -121,8 +121,16 @@ export class GameRuntime { // скрипты (с маркером // @roblox-lua) теперь идут через ОДИН LuaSharedSandbox. // .rbxl-скрипты распаковываем из JS-комментария-обёртки в чистый Lua. const luaUserBatch = []; + // По умолчанию импортированные .rbxl-скрипты НЕ выполняются: + // - типичная Roblox-карта = 500-2000 скриптов, многие используют + // DataStore/Tool/PlayerGui/UserInputService, которых у нас нет; + // - даже с stub'ами сотни падений → tab подвисает; + // Юзер может включить через window.__RBXL_RUN_IMPORTED = true в консоли. + const runImportedRbxl = typeof window !== 'undefined' && window.__RBXL_RUN_IMPORTED === true; + let rbxlSkipped = 0; for (const s of scripts) { if (s && typeof s.code === 'string' && s.code.startsWith('// @roblox-lua')) { + if (!runImportedRbxl) { rbxlSkipped++; continue; } const luaSource = unpackRobloxLuaCode(s.code); if (luaSource && luaSource.trim()) { luaUserBatch.push({ @@ -212,6 +220,9 @@ export class GameRuntime { if (rbxlImported > 0) { this._log('info', `Запущено Roblox-Lua скриптов (импортированных): ${rbxlImported}`); } + if (rbxlSkipped > 0) { + this._log('info', `Импортированных .rbxl-скриптов пропущено: ${rbxlSkipped}. Включить: window.__RBXL_RUN_IMPORTED = true`); + } if (luaWritten > 0) { this._log('info', `Запущено Lua-скриптов юзера: ${luaWritten}`); }