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

Why isn't this save data script working anymore?

I made this script a while back. After a while, it didn't seem to work anymore.

What happened was it only understood I have one thing. of an array of ten.

here's the script.

function Enter(plr)
	
	wait(.5)
	plr:WaitForDataReady()
	plr.leaderstats.Gems.Value=plr:LoadNumber("Gems")
	
	
		plr.BCGems.Value=plr:LoadNumber("BCGems")
	
	ge=plr.Gems:GetChildren()
	
	for i=1,#ge do
		ge[i].Value=plr:LoadNumber(tostring(i))
	end
	
	bc=plr.BCoins:GetChildren()		
		
	for i=1,#bc do
		bc[i].Value=plr:LoadNumber(tostring(i))
	end
end

function Exit(oplr)
	
	ge=oplr.Gems:GetChildren()
	oplr:SaveNumber("Gems",oplr.leaderstats.Gems.Value)

	oplr:SaveNumber("BCGems",oplr.leaderstats.BCGems.Value)
	
	for i=1,#ge do
		oplr:SaveNumber(i,ge[tostring(i)].Value)
	end
	
	bc=oplr.BCoins:GetChildren()		
	
	for i=1,#bc do
		oplr:SaveNumber(i,bc[tostring(i)].Value)
	end

end

game.Players.PlayerAdded:connect(Enter)
game.Players.PlayerRemoving:connect(Exit)

It used to work.

Please help. This is the game: http://www.roblox.com/games/249848896/AE-NC-Test-Demo

Thanks!

-ds

1 answer

✓ Accepted answer

It's becouse it came out the new data saving system, called Data Store. It's more efficient and it even works in other places (That is in the same game). Look for tutorials out there.

1 comment

0

My method works, as it saves some numbers properly. Thanks for the effort, though.

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