2 issues (Soultion Found :DDDDDD)

Yes I am


Where do i put this in the script

above the input service. This should fix the script

1 Like

I don’t get an error message anymore. Though save data script still won’t work…
What could possibly be wrong?

So the sword script works now?

Ye I dont get the error message. Though save data still won’t work.

Go to game settings and turn on http and API it is in security

They are both on, though save data STILL wont work. What the heck is going on!?!?!?

is it in ServerScriptService as a regular Script

Yep it is…


Can you setup a copy of your game and delete some parts of it so I cannot copy it with the dataSave and teamcreate it. I don’t know what else to do

1 Like

I figured out the issue, the script works however the BindToClose isn’t working. It isn’t even working for me. The issue is how it was in the beginning. There is not enough time to save the players data.

1 Like

With the bind to close it is endlessly sending requests. We do not want that which why I disabled it in my script. Give me a second and I will fix this.

1 Like

Ok cool tysm for all your help!!!

game:BindToClose(function()
local LastPlayer = nil
for _, player in pairs(game:GetService("Players"):GetPlayers()) do
	local player_stats = {}
	if player then
		if player ~= LastPlayer then
			for i, stat in pairs(player:WaitForChild("leaderstats"):GetChildren()) do
				player_stats[stat.Name] = stat.Value
			end
		end
		
		playerData:SetAsync("Player_"..player.UserId, player_stats)
	end
end
end)

I thought I could do it another way but I couldn’t. This should work.

Good luck and enjoy your coding!
Sorry for the bad mood but I am just tired and dealt with a lot of errors in my friends game.

Hey man its ok. Ive been trying to get this fixed ALL week. Thank you so much for helping me.

I tested it in a test game but like I said if you get any errors because of the bind to close just delete it knowing it works in the actual game.

No problem and feel free to message me on roblox if something goes wrong again with the scripts I gave you.

I also will make the script I sent to you public so you can use it because I think you will find stuff in there that will improve your coding

Mind if I friend you?