Code: Condensed to fit in website textbox
local a = game.Workspace.RemoteEvents.RequestAuth a.OnServerInvoke:connect(AuthCode)
RemoteEvents is a Folder Class
RequestAuth is a RemoteFunction Class
AuthCode is a function inside the script
Output:
18:23:39.788 - OnServerInvoke is a callback member of RemoteFunction; you can only set the callback value, get is not available
18:23:39.788 - Script 'game.Workspace.RemoteEvents.RequestAuth.OnServerInvoke:conn', Line 1
18:23:39.789 - Stack End
Question: I would appreciate any help on solving this, I know how remote events work so I attempted to translate that knowledge to a remote function because I need information to return.
This is the one of the two things I hate, and I mean hate about RemoteFunctions. Remote functions are a callback (and I don't quite get what that means, I guess they are meant to return a value). Which means they need to be in some special function, seeing as they are not technically a event like RemoteEvents.
To use bindable function, you would want to use the below code.
local a = game.Workspace.RemoteEvents.RequestAuth function a.OnServerInvoke(Player, AuthCode) --Since it is not a event, it will not need a connection line. Also, since this is likely being fired from the client, there is a variable automatically sent to the server containing the sender's value. So you might want to add that to the callback line. end
On a personal note, another thing I hate about RemoteFunctions is, you can't do this;
function game:service'ReplicatedStorage'.Test.OnServerInvoke()
or this;
function game.ReplicatedStorage['Test'].OnServerInvoke()