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

What is the name, scope and key for my datastore?

Asked by 3 years ago

I bought the datastore editor plugin so i could reset data easier and change data but im confused what the name key and scope are for my datastore

local DataStoreService = game:GetService("DataStoreService")

local ChugsData = DataStoreService:GetDataStore("ChugsData")
local MoneyData = DataStoreService:GetDataStore("MoneyData")
game.Players.PlayerAdded:Connect(function(player)
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player


    local Chugs = Instance.new("IntValue")
    Chugs.Name = "Chugs"
    Chugs.Parent = leaderstats

    local Money = Instance.new("IntValue")
    Money.Name= "Money"
    Money.Parent = leaderstats

    local data1
    local data 
    local success, errormessage = pcall(function() 
        data = MoneyData:GetAsync(player.UserId.."-Money")
        data1 = ChugsData:GetAsync(player.UserId.."-Chugs")

1 answer

Log in to vote
0
Answered by 3 years ago

local ChugsData = DataStoreService:GetDataStore("ChugsData") -- ChugsData is your datastore name for that local MoneyData = DataStoreService:GetDataStore("MoneyData") -- MoneyData is your other datastore name

idk what slope is but you dont need it to see data. (also not ordered datastore so dont check that)

key would be player.Userid-Money ex. 12345678-Money basically same thing with chugs

Ad

Answer this question