Causing any ‘Lua’ error (not from ROBLOX libraries or error functions) will overwrite every upvalue to some weird values. Usually numbers, threads and nil; depending on where the upvalue was indexed.
Reproduction code:
local x = "Hi"
coroutine.resume(coroutine.create(function()
while wait() do
print(x)
end
end))
a()
Output:
> error: attempt to call global 'a' (a nil value)
> 367
> 367
> 367
> 367
...
This is not a new bug. I went through this problem 1 year ago but didn’t know the exact cause. So far I see no harm for this behavior and can be useful for ugly hacks. But still it shouldn’t be happening.
Note that it only occurs online and from a script (not from developer console).