Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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...

5 comments

1

Currently there is not a way to do this.

0

I believe there are several modules in existence which do this (by manually listing the salient properties)

0

I think it is erroring at line 2 and also this system is very poopy

0

And has poor and sloppy coding. No offense

0

ik I never meant this as the actual code

1 answer

✓ Accepted answer

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.

1 comment

0

OK then, also pcall.

This discussion is preserved as it was. New answers, comments, and votes are closed.