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

or a hacky way to load meshparts

local loadService = game:GetService("LoadService")
local meshid = "urmeshid"
local mesh = loadService:LoadAsset(meshid)
mesh.Parent = workspace

imagine if loadservice didnt exist lol

yeah thats a way to bypass the issue, but the problem is to get the link of the meshobject.

something that’s hard.

what do you mean?

print(meshPart.MeshId) -- meshid

works for me.

oh? ok then yeah thanks for the tip!

Its just not writeable, but readable. Thats not true for scripts though.

They should, werid. Try .AutoRename enabled.

Hey, I’m currently experiencing issues when attempting to Encode Enums in version v0.7. The specific Enum I’m testing with is Enum.KeyCode.LeftShift.

Here’s a usage example Serialization.Encode(Enum.KeyCode.LeftShift), which results in the error: RBLXSerialize.Convertors:57: attempt to index nil with 'Value'.

The error seems to be caused because you’re not providing enough arguments for the EnumItem Convertor.

Value ModuleScript

	local convertor = convertors[ ValueType ]
	if convertor  then
		local converted = convertor(true, value)
		if converted then 
			return ValueString .. Binary.describe("DataType",ValueType)..Binary.describe("Value",converted)
		else 
			return nil 
		end
	else 
		return nil 
	end

Convertors ModuleScript

	["EnumItem"] = function(isClass,API,SubEnum,EnumValue) 
		if isClass then
			return string.pack("I2",EnumValue.Value)
		else 	
			return EnumStorage[Enum[SubEnum]][string.unpack("I2",EnumValue)]	
		end
	end,

You’re providing the function function(isClass,API,SubEnum,EnumValue) only two values convertor(true, value). So when return string.pack("I2",EnumValue.Value) is ran, EnumValue is nil.

I went ahead and did a bandaid fix on this, to see if that was the entire issue, but you’re also experiencing a very similar issue when Decoding.

I’m curious, am I using your Library wrong or are these legitimate bugs in your library? I feel like I’m using it wrong because the ‘bugs’ seem so straightforward, it’s as if whenever changes were made to the Enums handling, they were never tested.

Converting an enum to string is extremely simple that u dont need this module.

urenum.Name

Thanks, but that’s besides the point.

This is super useful!! I used it in my platforming game!

But it can not save SelectionBoxes?

I’ve kind-of abondoned this module, but if i were to release a new version i would probally overhaul it. It’s on github if anyone wants to fork it.

does this work with metatable that has model in it?

Plans for a full rewrite

I currently have plans for a full-rewrite learning from what i’ve learned from this module, main difference is the way the instance hirearchy is saved. It will allow for instances with the same names without having to change the names. Also more straightforward and readable code, i orginally never intended to make the module public which may explain some of the formatting issues and inconsistancies within the module. But seeing as there are not alot of alternatives and a limited knowledge on the subject. I think i may completely rewrite it as a full module.

For now,
I will go back and fix, enums, and bool decoding which are two issues i never addressed.

2 Likes

Yeah, welp its a big oversight on my part. Enums are only decodable from the instance decoder that gives a little bit of extra information about the (SubEnum or ParentEnum) i didn’t even realize that it wouldn’t work at all with the value conversions. So yeah untested completely, this is fixed in the new version but alast it isnt ready yet.

1 Like

Dunno if you are still going to do a rewrite; but it would be really cool if the rewrite could support normal datatypes such as tables, booleans, strings, and stuff like that intertwined with roblox data-types.

Hello, I love the module. It’s super easy to use, but I have one suggestion; can you add support for attributes? Thank you so much!

I already have a module for that.

Just took a look at it.

What if I need to store Instances in tables with some bools and vectors mixed in, I don’t see a way to get the best of both worlds here.

1 Like

Early version of rewrite

All progress will be transfered over to the re-write.

It isnt complete, so if your looking for something more reliable i’d recommend using this one for now.

Attribute support has been added in the rewrite version.