Object Serializer

I’ve created a plugin that turns your model into a script. It’s very helpful for those who load maps into games, such as Hide & Seek, Murder Mystery, Paintball, etc. You don’t have to put your model into Lighting/Replicated Storage.

Does it work with any instance?

It should. You just select all the parts you want to convert to a script.

** It tends to crash if you try to copy a really long script to your clipboard **

Pretty cool. It’s not the first that I’ve seen, as coolbob44 made a ‘Model To Script’ plugin before (see attachment), but his is longer available since LuaLearner’s shutdown. Here are some suggestions to improve yours though.


[ul]
[li]Change the names of the variables you create. As it is, if there are spaces inside of an objects name, your plugin will try to create a variable like {local Some Model Here = Instance.new(“Model”)}, which isn’t really what you want :p. Instead, you can try just using variable names like “obj#”.[/li]

[li]It’s not a good idea to set the parent property to an object by going through the data model {Parent = workspace.Model}, as you may end up referencing the wrong object. You’d probably want to store the data of previous parts already added in the script, and what variable name they’re going by.[/li]

[li]Joints (or at least Motor6D) won’t have their Part0, Part1, C0, and C1 properties set. On that subject, you’d probably want to make sure that they were added last to make sure that Part0 and Part1 have already been declared.[/li]

[li]You should also compare if the property of an object is already the same as the default instance when first created. There’s no reason to make Archivable = true when it’s already the default property of most objects.[/li]

[li]This script also won’t automatically weld joints and stuff. Perhaps you can call MakeJoints() after all of the Part’s properties are set.[/li]

[li]This isn’t really required, but you could try doing a bit of rounding for stuff outside of CFrame. As an example, the Friction property only goes up to three decimal places, so there’s no need for the script to do “Part.Friction = 0.30000001192093”. [/li]

[li]Finally, try adding in the ability for the script to get script data for multiple selected models at once instead of having everything under one big model.[/li]
[/ul]


By the way, what’s wrong with putting a model inside of ServerStorage or even ReplicatedStorage? I’d think it’d be a lot easier.

Object serialsers are cool. I made my own from scratch to get the models people build and save in my Pilgrim Islands Reborn place. Then I compiled the builds and put them together for a community egg hunt :3 http://www.roblox.com/Unofficial-Community-Egg-Hunt-2014-place?id=4015531