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

How do I load a model by using saved properties?

Asked by 7 years ago

I've got a script that allows the user to place a room down. To save the placed room, I made an array for every property of the parts/meshes/click detectors/unions/spotlights inside the room. Overall I have about 50 arrays for all the properties. Then I've made an array that stores all these property arrays called "arrays". This is my current code for when the player enters that builds the datastore:

function OnPlayerEntered(player)
    local DS = game:GetService('DataStoreService'):GetDataStore(tostring(player.userId));
    local arrays = DS:GetAsync('Build')
    local container = game.Workspace.ModelsContainer

    for i=1,#arrays do

    end;

end

game.Players.PlayerAdded:connect(OnPlayerEntered)

And this is in my player leaving script:

DS:SetAsync('Build', arrays);

However I'm not sure how to create the room out of these saved properties. Any information I should know and is there a better way to save the room instead of using 50 arrays?

0
i suggest you look at the f3x importer plugin and see how they did it Filipalla 504 — 7y

Answer this question