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

My Wins Leaderstats only works in studio. And I do not know what script is wrong!?

Asked by 1 year ago

local dataStore = game:GetService("DataStoreService"):GetDataStore("SaveData") game.Players.PlayerAdded:Connect(function(plr) wait() local plrid = "id_"..plr.UserId local save1 = plr.leaderstats.Wins

local GetSaved = dataStore:GetAsync(plrid)
if GetSaved then
    save1.Value = GetSaved[1]
else
    local NuberForSaving = {save1.Value}
    dataStore:GetAsync(plrid, NuberForSaving)
end

end)

game.Players.PlayerRemoving:Connect(function(plr) dataStore:SetAsync("id_"..plr.UserId{plr.leaderstats.Wins.Value}) end)


why does this only work in studio

I do not know if it is on the leaderstats script, datastore script or the wins on touch part script.

1
Can you please try to properly use a code-box? This makes reading the code needlessly harder. Anyway – have you checked the Developer Console in-game for errors? DindinYT37 246 — 1y

Answer this question