Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Hey guys, it isnt saving anything. can anyone help me?

Asked by 3 years ago
Edited 3 years ago
01local ds = game:GetService("DataStoreService")
02local cs = ds:GetDataStore("Cash")
03 
04game.Players.PlayerAdded:Connect(function(plr)
05    local Cash = plr:WaitForChild("leaderstats"):WaitForChild("Cash")
06 
07    local data
08    local succ, err = pcall(function()
09        data = cs:GetAsync(plr.UserId.."_cash", Cash)
10 
11        if succ then
12            Cash = data
13            print("a")
14        end
15    end)
View all 30 lines...

please help! it says

when i leave which means nothing or there was an error

0
Replace it with this: FarmIzMyLife 0 — 3y
0
Replace it with this:                                                                                                                         local Players = game:GetService("Players") local DataStoreService = game:GetService("DataStoreService") local Saver = DataStoreService:GetDataStore("SaveLeaderstats") Players.PlayerAdded:Connect(function(player) local Data = nil local success, errormessag FarmIzMyLife 0 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

Please use nice words and not ''Guys'' I personally can't stand this. Try to put value behind Cash.

1Cash.Value = 0

I see you did this at line 19, try to do this at line 5, 9 and 12 too.

Reply if it doesn't work!

Ad

Answer this question