RBLXSerialize - a easy to use and really cool all-in-one Roblox Serializer

I would assume not as i beileve it is just a normal lua table?

For encoding and decoding strings, use the code example below.
I didn’t see any see an example listed for strings so I quickly threw this together for people wanting to. If there is an example already listed for strings then I just need to get my eyes tested lol.

But anyways, this is an example for decoding and encoding strings. (Helpful for hiding token and auth codes for Trello in a module so if someone saveinstances your game they can’t see the token or auth strings without knowing how to decode it.)

Script:

local RBLXSerialize = require(script.Parent.RBLXSerialize) 

local BinaryString = RBLXSerialize.Encode("test string",true)
local StringDecoded = RBLXSerialize.Decode(BinaryString,true)

print("Encoded output: "..BinaryString)
print("Decoded output: "..StringDecoded)

Output:
1

bro they can just copy the encoded token and decode it

Not if you encode the results a few times and make a script to decode it the same amount of times, also they’d have to know to look here to find out.

Anywho, I’m pretty sure you can change the values that it encodes it in to make your own custom encode/decode language seems as this is open source.

So is it actually possible to serialize/deserialize scripts? I mean considering what you just said, i guess thats true? Would be a heckton useful for stuff that needs to be eventually be imported to save system resources. Or even better, store stuff that a player has customized.

Why would you be serializing meshes, vehicles, welds, scripts, etc?

Sensitive data or data that can be generated from less information should never be stored. You can always clone a base model and modify it to your liking from saved data. Items such as Welds should not be saved as they can be destroyed in the construction process. Just re-weld the model/object afterwards.

Forgot to add that this is an amazing resource. Big thanks, will be using this in the future. @AwesomeXForLife

Why would you be allowing an exploiter to view private keys? FYI for anyone reading, exploiters cannot read the following :
ServerStorage
ServerScriptService
Server-generated/controlled instances (Scripts, not to be confused with localscripts or modulescripts)
Offsite stored keys (assuming the webserver is not publicly shown)

Your keys should never be stored in a place where an exploiter can read them. Client’s only have so much power.

That is SO NOT the case, the RBLXSerialize module actually works well with meshes and welds.

I mean why not? why not serialize all the stuff?

There are several reasons to that question. But i dont see those stuff as sensitive data at all.

???

Why not serialize all the stuff you ask, the answer is right below.

Serialization is the act of giving an object an identifier. Most data types on Roblox such as CFrames, Positions, Instances, and so on cannot be serialized. The way around this is modules like these.

The reason however why you would never want to serialize everything is because of performance issues, especially when saving and loading said serialized data.

When you are loading a Model with 100 parts, and each part is being created and loaded from saved data, you are using up memory because instead of Cloning a base model and changing properties from there, you are generating a new model from scratch. (Much better to use SetPrimaryPartCFrame instead of 100 positions being changed). That in itself is not so bad, a few KB of memory, whatever. The issue is that when you are using more data types (Welds, Meshes, Models, Parts, Unions) and so on, you are serializing more and more data. Roblox does have a data limit (if I’m not wrong it’s 260K characters after JSON encoding). Once you reach that data limit, issues will occur (not to mention that memory will start to crash servers).

tl;dr : don’t serialize and save everything because Roblox has a data limit and it uses up massive amounts of memory based on the amount of instances you are serializing (leads to server crashes)

It’s actually 4MB for a while now.

Please consider using new Pivot API instead of superseded SetPrimaryPartCFrame

1 Like

I don’t allow people to view that.

However, people that have synapse can use a saveinstance script and saves the code for all LocalScripts and Modules. My point is if you encode a string that is valuable, e.g. a token/auth code for trello accounts, the hacker won’t be able to get to it unless they know how to decode it using the RBLXSerialize module.

So when I showed the example of encoding/decoding strings was so that people can add an extra level of security for attempting to hide data in modules so that you can easily update it for all scripts without having to change the token in each and every individual script.

Someone is still determined to find 82917 ways to decode it

wait wouldnt it be better to store the token in a datastore? somewhere thats not easy to access?

2 Likes

Hmm, good point well made. I never really thought of datastores because I hate them so much but yeah that way is more secure by far.

Yeah, you can make a Model Storage Datastore or M.S.D, with the combination of this module

you can actually make a datastore that stores alot of models via strings/tokens. Which can be accessed by the name of the model (or however you want it). That would be a cool thing to do.

Besides the models themselves barely take any space in datastores (Kb < 4MB limit).

Need to store models of rooms for missions and etc? simple use this module and serialize them. After that, you store the token/BinaryString into a DataStore called “MissionRooms” and assign a name to them so that you can identify them.

1 Like

I understood that part, the issue I’m having is why is the client gaining access to said trello token/auth code?? If it’s stored on the server they can’t access it?

This is great stuff. I’ve been working on something similar in the form of a single module, parented to game. The module acts exactly like a service, and the code is executed through the command bar with a require(module:Clone()), so it can be changed and executed without having to reseat the module.

Alright, I’ve released a counterpart to this module called RBNSR.

It’s used if you dont need to store full instances, and allows you to store tables /w DataTypes supported in this list. (Its a single modulescript).

How can i make it so that the things that this module serializes (aka the table it produces) saves to where i want it to be other than datastores?

It doesn’t matter where you store the string, it will work regardless. So if you’d like to store it in a variable that’s fine. You could also store it inside of a StringValue if you’d like. As long as the string remains unmodified it will work.