Hello! I am trying to look for a JSONEncode module. Basically, I want the JSONEncode function but its source code in a script/module-script. I’ve seen this done with the loadstring() function, but was wondering if the JSONEncode function has it too. I need this because I am experiencing bugs with my code that just don’t make sense, like “couldn’t convert to json.”
Here, just use HttpService?
game:GetService(“HttpService”):JSONEncode(TableHere), or Decode also works. This works on both the client and the server! Very good for storing Tables!
It is not, actually. I am obfuscating for privacy and reasons of my own. Unobfuscated it works perfectly fine. Its suppose to send a embed to discord showing bans, kicks, and other logs of the user/s. If I could have the source code, I could figure out what went wrong and fix it.
I don’t understand what you mean. How would having the source code of a core function help you fix your discord bugs? You are using it incorrectly for it to error.
Search up “loadstring” in the toolbox and you will find a module script with the source code of the function in it. It would help me as I could see whats going wrong without just calling the function and guessing.
The core functions’ source is not publicly available, nor is anyone legally allowed to read or use it other than the owners of the code.
You still have not explained what you are doing with the JSONEncode function to trigger this error. Obviously, you are passing some kind of input into the function or you would get no output. What are you passing into the function?
I have explained it. I am encoding a embed to send to discord. It works when not obfuscated, but when obfuscated it breaks. I have no clue why this is happening and can’t just print it. I hope this answers your questions.
I tested this out with some placeholder strings in place of the variables, and it worked just fine. If I had to guess, you’re accidentally encoding an instance.
I am going off of this tutorial. Webhook's and their Embeds
It still works and i’m pretty sure your example and mine both work. I will still test this.
Yes, but when obfuscated it gives an error. I have another script the same as this one but when obfuscated works. It says “Couldn’t convert to json.” So something is wrong with my code, but I just don’t know what.