I know that data persistence is terrible for data store, but i just want to test stuff.

i made a script that saves a number to data persistence for testing, but it doesnt work. the value is getting changed by the sevrer

Also does data persistence still work, or is it removed?

key = "efw"

game.Players.PlayerAdded:Connect(function(plr)
	wait()
local d = Instance.new("Folder")
d.Name = "leaderstats"
d.Parent = plr
local m = Instance.new("NumberValue")
m.Value = 0
m.Parent = d

plr:WaitForDataReady()

m.Value = plr:LoadNumber(key)
end)

game.Players.PlayerRemoving:Connect(function(plr)
plr:SaveNumber(key,plr.leaderstats.Value.Value)
end)

thx lol

5 comments

0

Some of data persistence api may be available but as far as I know it has been removed.

0

Where can i know it has been removed?

0

Data Persistance is deprecated. Use DatatStores instead.

0

DataStoreService cant save instances

0

thats the reason, i wanna store instances to datastore, but im too dubm i still dont know how to serialize them.