Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Instances + Data Stores?

Asked by 10 years ago

Im not sure how to save Instances with Data stores, It says on the wiki to create a function to turn it into a table, But how would I do that? I dont use Tables alot, and my game consists of over 50k+ bricks, So saving each brick's property and loading a new instance doesnt seem very efficient.~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~

1 answer

Log in to vote
0
Answered by 10 years ago

I created a quick module to do something like this, just for experimental purposes. This is how it came out, remember that you will need to modify this script to make it updated for improved usage. (Using JSON, etc.)

local Parts = {}

function Parts:Create(Part)
    self[Part.Name] = {['BrickColor'] = Part.BrickColor, ['Name'] = Part.Name, ['Position'] = Part.Position, ['Anchored'] = Part.Anchored, ['CanCollide'] = Part.CanCollide, ['FormFactor'] = Part.FormFactor, ['Size'] = Part.Size}
    return self
end

return Parts
0
Saving 50,000 blocks in tables is not very realistic, you must remember that the DataStore saves tables internally as JSON and have a maximum length of 65536 characters per sync, there are scripts/modules that encode instances into strings, here is an example of one http://www.roblox.com/--item?id=176696010 Epidemiology 116 — 10y
0
Interesting, hadn't seen that yet. I agree, it's not realistic but saving Instances isn't very good on ROBLOX. RaverKiller 668 — 10y
0
Thanks! This helped me alot! xtremetemper 5 — 10y
Ad

Answer this question