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)
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
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