Hello there! I'm making a player invite system for my game. I am having a problem with a RemoteFunction that requests a variable (invite) from a local script, inside a player's ScreenGUI. This is the server-sided script:
function game.ReplicatedStorage.Remotes.InvitePlayerServer.OnServerInvoke(player)
local invite = game.ReplicatedStorage.Remotes.InvitePlayerLocal:InvokeClient(player,player.Name)
return invite
end
The local script receives the invite and returns the variable accordingly, but not the way I intended: the local player is supposed to send an invite to any given player, and then the player invited should receive the message. When I tested this script, the local player receives the invite. Shouldn't the server-sided script be able to invoke RemoteFunction to any client it chooses, instead of the local player? Any help is appreciated, and I apologize if this isn't very clear. Thanks!

3 comments
Don't use OnClientInvoke. The client can choose to return bad information or choose to not return anything at all which will cause the server to yield until a result is received
Is there another way I can use a remote function?
Figured out the problem lies in the InvokeServer, not the InvokeClient. It sends the player invited as an argument to the server script, but the server script receives the local player. Any help?