So I have a simple function to save data. After a while of going through my script I found that it has to be the SetAsync function that is causing my data to not save/load properly as the GetAsync function works fine, just returning nil.
local function SaveData(id, data)
print("Test1")--Prints
local s, m = pcall(function()
print("Test2")--Prints
PlayerData:SetAsync("User_"..id, data)
print("Test3")--Doesn't print
end)
print("Test4")--Doesn't print
if m then
warn(m)
end
print(s)
end
As you can see the function moves through up until it reaches the SetAsync function of the PlayerData datastore. Im not quite sure why this is happening and I have tried many things to try to fix it in other parts of my script.

2 comments
No error. I have enabled api services, and data saving used to work.
Show the full script. I can see PlayerData isn't referenced in this script. Can I help if you won't show us? Show the FULL script or go elsewhere.