Hello there! I used a free model to have a datastore since im not to familiar with datastore stuff. But i want to be able to edit my data store with the datastore v3 editor, but it asks me for a scope and name and key. could you help me try to find the key and stuff?
Script:
local statsDS = DSS:GetDataStore("statsDS")
game.Players.PlayerAdded:Connect(function(plr)
local Afolder = Instance.new("Folder") --created a new folder
Afolder.Name = "Artil"
Afolder.Parent = plr
local Blood = Instance.new("NumberValue")
Blood.Name = "Blood"
Blood.Parent = Afolder
Blood.Value = 0
local DefaultKnife = Instance.new("NumberValue")
DefaultKnife.Name = "DefaultKnife"
DefaultKnife.Parent = Afolder
DefaultKnife.Value = 1
local DefaultGun = Instance.new("NumberValue")
DefaultGun.Name = "DefaultGun"
DefaultGun.Parent = Afolder
DefaultGun.Value = 1
local Knife2= Instance.new("NumberValue")
Knife2.Name = "Knife2"
Knife2.Parent = Afolder
Knife2.Value = 2
local Tokens = Instance.new("NumberValue")
Tokens.Name = "Tokens"
Tokens.Parent = Afolder
Tokens.Value = 0
local data
local succ, err = pcall(function()
data = statsDS:GetAsync(plr.UserId.."-stats")
end)
if succ then
print("success")
if data then --if there was some data then
print("Got the data from the player datastore")
Blood.Value = data[1]
DefaultKnife.Value = data[2]
DefaultGun.Value = data[3]
ChromaDarkBringer.Value = data[4]
Tokens.Value = data[5]
end
else
print("There was an error while checking: "..plr.Name)
warn(err)
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
print("Player is leaving the game!")
local Blood = plr.Artil.Blood.Value
local DefaultKnife = plr.Artil.DefaultKnife.Value
local DefaultGun = plr.Artil.DefaultGun.Value
local Knife2= plr.Artil["Chroma DarkBringer"].Value
local Tokens = plr.Artil.Tokens.Value
print("Got all the values")
local data = {Blood, DefaultKnife, DefaultGun, Knife2, Tokens}
local succ, err = pcall(function()
statsDS:SetAsync(plr.UserId.."-stats", data)
end)
if succ then
print("Succesfully saved the data!")
else
print("There was an error while saving player leaderstats!")
warn(err)
end
end)