Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

This save/load script used to work, but now it doesn't?

Asked by 10 years ago

this used to save peoples intvalues but it doesnt anymore

wait()

game.Players.PlayerAdded:connect(function(player)
local intv= Instance.new("NumberValue",player)
intv.Name = "fv1"
intv.Value = 0

player:WaitForDataReady()
if player:WaitForDataReady() then
local onions=player:LoadNumber(player.fv1.Name)
player.fv1.Value=onions or 0
print("I think it's DONEE") 
end
end)


function onPlayerLeaving(player)


player:SaveNumber(player.fv1.Name,player.fv1.Value) 
end



game.Players.PlayerRemoving:connect(onPlayerLeaving)

This is what it tells me in the dev console log. "Workspace.savemv1:15: attempt to index local 'Loaded' (a nil value)"

Answer this question