Passing a table through a remote function?

Trying to set up a remotefunction to check if an item is owned before allowing the user to buy the item in order to stop being able to buy multiple of one item so to do this I have a server script check through their inventory and put the owned items into a table:

But when it comes to the local script I have this:

When printing the table it just prints nil

1 Like

I recommend you to check these things from server only, because the server can detect clicks by a player, so if you add a MouseButton click event on a button from the server then the server will be able to detect it and you can do that rest from there.
using a remote function kinda slows the process and can also be risky because of hackers.

Ummm you have no table as a variable in the local script so it prints nil. You also don’t have anything named weapon1owned

Weapon1Owned is inside the table from the serverscript, I just dont know how to put the table from the serverscript through to the local script

Ive changed it to this so a hacker cant change the value themselves

solved by replacing a table with another method, sending a number value to the serverscript depending on the item and then using that number to search for the matching weapon and return either true or false