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

[Solved]How do I save a metatable to a datastore?

I looked it up recently and what I read said that datastores cannot store metatables. Is there anything that I can substitute in a way that wont break my script? By the way I am only saving a list of numbers. Could someone help me out please? Thanks!

1 answer

save the metatable as a table, meaning you save 2 tables, one is the actual table, the second one is the metatable

{
	Table = { 
		1,
		"hello",
		123.45
	}
	Table_Meta = {
		__add = function(a, b)
			warn("foo")
			return 123
		end,
		__index = error("no")
	}
}

1 comment

0

Sorry but that wont work for what I am trying to do. Thanks for your help though.

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