Im working on a plugin, whenever I try to load a file via command, it throws “attempt to yield across metamethod/C-call boundary”
Loop:
for pattern, func in pairs(specialfunctions) do
args[i], rep = string.gsub(v, pattern, func)
if rep ~= 0 then continue end
end
local specialfunctions = {
['%loadscript/.*%'] = function(name)
return env.userScripts:LoadScript(name) or 'nil'
end,
['%loadfile%'] = function()
local file = SS:PromptImportFile({'txt', 'lua', 'luau'})
if file then
return file:GetBinaryContents()
else
env:Output('loadfile() cancelled.')
return 'nil'
end
end,
}
Callstack:
attempt to yield across metamethod/C-call boundary - Edit - InputProcessor:35
00:59:22.375 Stack Begin - Studio
00:59:22.375 Script 'user_Terminal.rbxmx.Terminal.Scripts.InputProcessor', Line 35 - Studio
00:59:22.375 Script 'user_Terminal.rbxmx.Terminal.Scripts.InputProcessor', Line 64 - function Split - Studio
00:59:22.375 Script 'user_Terminal.rbxmx.Terminal.Scripts.Init', Line 66 - Studio
00:59:22.376 Stack End - Studio
00:59:24.786 cannot resume non-suspended coroutine - Edit - InputProcessor:35
00:59:24.786 Stack Begin - Studio
00:59:24.786 Script 'user_Terminal.rbxmx.Terminal.Scripts.InputProcessor', Line 35 - Studio
00:59:24.786 Script 'user_Terminal.rbxmx.Terminal.Scripts.InputProcessor', Line 64 - function Split - Studio
00:59:24.786 Script 'user_Terminal.rbxmx.Terminal.Scripts.Init', Line 66 - Studio
00:59:24.787 Stack End - Studio