Data wont save and wont show any errors

i heard that you need to keep bindtoclose

1 Like

also idk since my version still works

1 Like

I took a look at your code and I don’t understand cause in your old code you were trying to save players data when the server shut down but you’re already saving their data when they leave so you don’t need to keep !
EDIT : plus you’re trying to get player but they doesn’t exist since they leaved the game !

1 Like

I will update the message where I send you the code !

i know since i keep getting this error BindToClose failed because the model is already being closed.

1 Like

oops in mine code this is the part i forgot to look in my code

local mainstats = Player.Gmultis:GetChildren()
	for v, ValueInstance in pairs(mainstats) do
		if ValueInstance:IsA("ValueBase") then
			Data[ValueInstance.Name] = ValueInstance.Value
		end
	end
1 Like

You don’t need mainstats since you can do Player.leaderstats:GetChildren() !

yeah i know but ill keep it since it still works so ye

1 Like

i use 4 different leaderstats scripts since in 1 script a lot of them wont be created

2 Likes

hi back again! here’s a link to a similar issue i just helped a guy with

DataStore not saving, Not getting an error or success message - Help and Feedback / Scripting Support - Developer Forum | Roblox

to use game:BindToClose(function()

as shown im my post

yeah since that i improved in scripting a lot now mostly i dont get errors and if i do i can fix them easily

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.