For my game I want to have functions in tables that do specific things. And I want to save them to data, and JSONDecode them after their data is loaded so it runs those functions. But when I tried to decode my function as a test, it gave me this in the output: ‘Can’t parse JSON’
The instance method JSONDecode() decodes JSON strings into Lua tables, so of course you can’t decode Lua functions using it.
Instead of functions, why don’t you just store instructions for the server to run premade functions? That way you have full control over what’s being run in your game.
Besides, it’s impossible to store functions inside data. You’d have to write your functions as strings and call them via loadstring.