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

How do i Save Models For My Game?

Asked by 6 years ago

I'm trying to make a game and i need to be able to save model or part and load them. I tryde Making a part adding it into a table and then load it into the workspace


local numberarray = {}

function add()
    local Cat = Instance.new("Part")
    Cat.Name = "KingRaul"
    Cat.Parent = workspace
    Cat.Material = "Neon"
    Cat.BrickColor = BrickColor.new("Toothpaste")
    wait(5)
    print("Got it")
    table.insert(numberarray,Cat)
    print(numberarray[1])

    wait(5)
    for i,v in pairs(numberarray:) do
        v:Clone().Parent = workspace
        print("Going to Workspace")
    end
end
add()

1 answer

Log in to vote
0
Answered by 6 years ago

The problem is that you cannot save instances inside datastore.

If you need to save one part you could simply use boolvalues and numbervals to create the part

But with multiple I recommend using strings to store more information

Like NAME_PROPERTY_VALUE

You can use a lot of info from here and here

Ad

Answer this question