Remote Function Stopped Working

So, I was editing the server side script and went in to test what I had written but found out it wasn’t working. I thought it was just a bug with my code and tried to pinpoint the problem. I put a bunch of print statements everywhere and came to find out my code was freezing up when attempting to invoke the server with a remote function. I have no clue why it is doing this because even after reverting to a version of the game that I know for a fact worked, the same remote function is not working. I put print statements before and after the line that invokes the server and before and after the server-side script, the only print statement that executes is the one right before the invoke server line. And I’ve checked, the remote function in ReplicatedStorage still exists and the console prints no errors.

---Local Script
	print('Sending WearCostume to TaggerCostumeFunctions', script.Parent.CostumeName.Value)
    game.ReplicatedStorage.RemoteFunctions.WearCostume:InvokeServer(plr, script.Parent.CostumeName.Value)
	print('Sent it')

---Server Script
function game.ReplicatedStorage.RemoteFunctions.WearCostume.OnServerInvoke(plr, costumeName)
	print('TaggerCostumeFunctions received from WearScript', plr, costumeName)

What else should I be testing for to resolve this? Especially since even reverting back to older versions doesn’t fix the problem?

Remote events and remote functions are not to be used interchangeably as they have different purposes. Remote functions are meant for giving back data to the requester. In this case, the client should request data from a remote function by the server, and the server gives data back to the client. :InvokeServer yields until a response is received, however you are not giving back a response. Either make good use of the remote function or switch to a remote event.

1 Like