DataServices aren't Working =/

Hello! So Ive been working on a SaveData Script and when I tried it it wouldn’t work when I left the test game none of the data saved. I also did it In a real server *** Meaning that

This came in the output

  14:49:07.327  Expected ':' not '.' calling member function GetService  -  Server - SaveData:1
  14:49:07.328  Stack Begin  -  Studio
  14:49:07.328  Script 'ServerScriptService.SaveData', Line 1  -  Studio - SaveData:1
  14:49:07.328  Stack End  -  Studio

The Script

local ds = game.GetService("DataStoreService"):GetDataStore("SaveData")
game.Players.PlayerAdded:Connect(function(plr)
	wait()
	local plrkey = "id_"..plr.userId
	local save1 = plr.leaderstats.Kills
	
	local GetSaved = ds:GetAsync(plrkey)
	if GetSaved then
		save1.Value = GetSaved[1]
	else
		local NumberForSaving = {save1.Value}
		ds:GetAsync(plrkey, NumberForSaving)
	end
end)

game.Players.PlayerRemoving:Connect(function(plr)
	ds:SetAsync("id_"..plr.userId, {plr.leaderstats.Kills.Value})
end)

There is a point instead of two points.

local ds = game:GetService("DataStoreService"):GetDataStore("SaveData")

Quiet, it usually happens

1 Like

My bad, thanks for helping!

I havent tested it yet but I will in a sec

Being honest Its not that I didnt care, Im used to putting a period after game

1 Like

You’re welcome, happy to help ^ - ^
It happened to me once with capital letters when the scripts still didn’t have so many colors xd

1 Like

Ok hell has happened =,)

  15:10:20.385  502: API Services rejected request with error. HTTP 403 (Forbidden)  -  Server - SaveData:7
  15:10:20.385  Stack Begin  -  Studio
  15:10:20.386  Script 'ServerScriptService.SaveData', Line 7  -  Studio - SaveData:7
  15:10:20.386  Stack End  -  Studio
  15:10:23.748  502: API Services rejected request with error. HTTP 403 (Forbidden)  -  Server - SaveData:7
  15:10:23.748  Stack Begin  -  Studio
  15:10:23.749  Script 'ServerScriptService.SaveData', Line 7  -  Studio - SaveData:7
  15:10:23.749  Stack End  -  Studio
  15:11:27.855  ServerScriptService.FightingHandler:42: attempt to index nil with 'Name'  -  Server - FightingHandler:42
  15:11:27.856  Stack Begin  -  Studio
  15:11:27.857  Script 'ServerScriptService.FightingHandler', Line 42 - function FireRemote  -  Studio - FightingHandler:42
  15:11:27.858  Stack End  -  Studio
  15:11:33.086  ServerScriptService.FightingHandler:42: attempt to index nil with 'Name'  -  Server - FightingHandler:42
  15:11:33.087  Stack Begin  -  Studio
  15:11:33.089  Script 'ServerScriptService.FightingHandler', Line 42 - function FireRemote  -  Studio - FightingHandler:42
  15:11:33.089  Stack End  -  Studio
  15:11:33.458  ServerScriptService.FightingHandler:42: attempt to index nil with 'Name'  -  Server - FightingHandler:42
  15:11:33.458  Stack Begin  -  Studio
  15:11:33.458  Script 'ServerScriptService.FightingHandler', Line 42 - function FireRemote  -  Studio - FightingHandler:42
  15:11:33.458  Stack End  -  Studio
  15:11:33.459  ServerScriptService.FightingHandler:42: attempt to index nil with 'Name'  -  Server - FightingHandler:42
  15:11:33.459  Stack Begin  -  Studio
  15:11:33.459  Script 'ServerScriptService.FightingHandler', Line 42 - function FireRemote  -  Studio - FightingHandler:42
  15:11:33.459  Stack End  -  Studio

The whole game had a mental breakdown and its all broken

This active:

Change this:

For this:

ds:SetAsync(plrkey, NumberForSaving)

For the rest, I need you to send the code fragment that causes the error.

1 Like

code fragment? also I already had both of those activated

That means that on line 42 on that script the word before “.Name” is nil.

The line causing the error and some around it.

Line
Line
Error
Line
Line

Same thing happened, exept the sword is working fine again

  15:53:57.289  502: API Services rejected request with error. HTTP 403 (Forbidden)  -  Server - SaveData:7
  15:53:57.289  Stack Begin  -  Studio
  15:53:57.289  Script 'ServerScriptService.SaveData', Line 7  -  Studio - SaveData:7
  15:53:57.289  Stack End  -  Studio
  15:53:58.731  502: API Services rejected request with error. HTTP 403 (Forbidden)  -  Server - SaveData:7
  15:53:58.731  Stack Begin  -  Studio
  15:53:58.731  Script 'ServerScriptService.SaveData', Line 7  -  Studio - SaveData:7
  15:53:58.731  Stack End  -  Studio

EDIT: I FIGURED OUT API SERVICES DISABLED ITS SELF

If this does not solve it, send the script.

1 Like

Conclusion: Its working now thanks for help

EDIT: Post below

1 Like

Now its fixed again…

At this point its roblox acting wonky