In a script inside a RemoteFunction, which is inside workspace, I have the following:
function script.Parent.OnServerInvoke(_)
return function()
print("hi");
end;
end;
Then, inside a LocalScript, which is inside the StarterGui, I have the following:
local function loadstring(src)
return workspace.RemoteFunction:InvokeServer(src);
end;
loadstring()();
This causes the following error:
12:35:23.263 - Players.Player1.PlayerGui.LocalScript:4: attempt to call a nil value
12:35:23.263 - Stack Begin
12:35:23.263 - Script 'Players.Player1.PlayerGui.LocalScript', Line 4
12:35:23.263 - Stack End
What's wrong with this application?

1 comment
Probably to prevent that loadstring hack where you can just return a function from the server. But there might be an actual reason.