In the first pic, you can see im invoking the server with the backpack function. the second pic is where im messing up and im not quite sure how to go about it. i cant call onserverinvoke (which would be sending data back to the client?) because theoretically, i’m calling backpack:sort from the client. and when i do onclientinvoke, obv nothing happens. I understand remote events but when it comes to functions i have a bit of trouble. Im almost certain i have the client (first pic) setup correctly, i’m just not sure how to setup the module script to return the data to the client.
.I’ve tried searching through the forum, and a few stackoverflow posts but couldn’t come up with anything.
I’m so confused here with what’s client and what’s server. Your calling a function named :sort() that I assume returns some sort of inventory data which your then going to send to the server and get a response but why are you running .OnClientInvoke in your module? To get the data shouldn’t you just provide the server what information your requesting and it will return it?
I suppose thats what i’m asking to figure out. The first picture is my client server, yes backpack:sort() returns inventory data. I invoke the server (first pic) so i can get the data (which is done on line 11 of the second pic) and then I need to return it back to the client.(which i assume is what im doing when im setting invdata to the event in line 10 of pic 1)