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

Is there a way to get a list of propeties in a instance?

Asked by 8 years ago
Edited 8 years ago

Is there a way to get a list of propeties in a instance because i wan't to make a module that can save - load instances using data store.

Idea:

local module = {}
local instanceStorage = game:GetService("DataStoreService"):GetDataStore(game.PlaceId .. "INSTANCE") --Pfft

function saveInstance(instance, name)
    local saveData = {}
    for i,v in pairs(--[[Properties of Instances]]) --Problem
        table.insert(saveData, v) --Insert value
    end
    instanceStorage:SetAsync(name, saveData) --Save!
end

function loadInstance(name)
    --no idea left
end
return module

This is the bad example, but OK...

1
Currently there is not a way to do this. User#5423 17 — 8y
0
I believe there are several modules in existence which do this (by manually listing the salient properties) BlueTaslem 18071 — 8y
0
I think it is erroring at line 2 and also this system is very poopy User#10445 15 — 8y
0
And has poor and sloppy coding. No offense MrLonely1221 701 — 8y
0
ik I never meant this as the actual code MinePlayersPE1 33 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

As kingdom5 said, you can't really do this in an easy way, like no method to instantly do so. Although, you could do something like:

game.Workspace.Part.Transparency
game.Workspace.Part.Name
...

My point being you would need to access each and every property.

0
OK then, also pcall. MinePlayersPE1 33 — 8y
Ad

Answer this question