(found a solution)
For some reason my Data Store script isn't working. I have checked the API Services and HTTP Requests boxes. Also the data store doesn't work not only in the studio but also in the game itself. There are no errors found aswell Please help!
Here is 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.Bucks
local save2 = plr.leaderstats.Character
local save3 = plr.leaderstats.CA
local GetSaved = ds:GetAsync(plrkey)
if GetSaved then
save1.Value = GetSaved[1]
save2.Value = GetSaved[2]
save3.Value = GetSaved[3]
else
local NumbersForSaving = {save1.Value,save2.Value,save3.Value}
ds:GetAsync(plrkey, NumbersForSaving)
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
ds:SetAsync("id_"..plr.userId, {plr.leaderstats.Bucks.Value, plr.leaderstats.Character.Value, plr.leaderstats.CA.Value})
end)

12 comments
It still doesnt work... One of my values is a string value. Maybe thats why it doesn't work?
So, you're telling me you're trying to save something that isnt a stringvalue nor numbervalue?
What is it, then?
Intvalue and a string value
It should save if it isnt a object (for example, a model). I dont know what is wrong.
Does it give any errors?
no. thats why i don't know what's happening
maybe theres something else blocking the data from saving but i cant seem to find anything
Have you tried changing player.userId to player.UserId?
yes
Hmm, I have no idea what could be wrong in your script. Sorry.
I checked and only one of the values didn't save. Thank you! Edit: The value didn't save because i did something else wrong.