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

don't know how to check if an object's name is in a table... help?

ok i'm making a tycoon game and i'm trying to implement a save system. i have made some code that successfully saves the data (or so i've seen) but the loading data is the problem. i saved all purchased objects into a table, then inserted the purchased objects table into another table along with the players cash amount. when loading the tycoon, i pull out a clone from which i get the purchases from. then, i made some code that finds all the children of the purchases folder, then checks if the purchase's name is found in the purchased objects table. if so, move the purchase into the purchased objects folder. however, i don't know exactly how to check if the purchase's name is found in the purchased objects table......... i have tried

for i = 1, #purchases do
	local v = purchases[i]
	
 	if tycoonData[v] then
		print('a')
	end
end

but that doesn't seem to work, no errors in the output. help please

1 answer

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