This function will throw an error if called on a C closure, such as print, for security reasons.
debug.getupvalue returns the upvalue at the specified index from a Luau function's closure. If the index is invalid or out of bounds, an error will occur.
localUpFunction=function()print("Hello from up")endlocalfunctionDummyFunction()UpFunction()endlocalRetrieved=debug.getupvalue(DummyFunction,1)Retrieved()-- Output: Hello from up