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

How do i make a data save, I typed below what i've tried?

Asked by
8cxg 2
4 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

I've tried local dataStore = game:GetService("DataStoreService") game.Players.PlayerRemoving:Connect(function(player) local success,errormessage = pcall(function() dataStore:SetAsync("oof-"..player.UserId,player.leaderstats.Oofs.Value) dataStore:SetAsync("rebirths-"..player.UserId,player.leaderstats.Rebirths.Value) end) end) But it doesnt seem to work.

0
this is hard to read Ali_MTR 30 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Can you send the full script? I can't really seem to know the real issue here.

0
local serverStorage = game:GetService("ServerStorage") local dataStore game:GetService("DataStoreService"):GetDataStore("PlayerDataSave") local player = game.Players.LocalPlayer game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player local rebirths = Instance.new("IntValue") rebirths.Name = 8cxg 2 — 4y
Ad
Log in to vote
-1
Answered by
iWasThisi -15
4 years ago

I have a model that saves leaderstats if you put it in serverscriptservice I could link it to you if that would help?

https://www.roblox.com/library/5061331155/DataStore-SAVING-LEADERSTATS

0
Its not for sale so i cant grab it. 8cxg 2 — 4y
0
There Now You Can! Hope This Helped! iWasThisi -15 — 4y

Answer this question