Refer to specific Value (Leaderstats, DataStore2)

  1. What do you want to achieve?
    I want that only the number of Tokens increases and not all the values that I have in leaderstats (Tokens, Kills and Level)

  2. What is the issue?
    Obviously every stat will increase by 10 since I do not know how to refer to a specific Value.

local DataStore2 = require(1936396537)

script.Parent.Triggered:Connect(function(plr)
    local TokenDataStore = DataStore2("Tokens", plr)
    TokenDataStore:Increment(10)
    script.Parent.Parent:Destroy()
end)

The script I wrote above^
To avoid confusion ‘‘Tokens’’ is the name of the DataStore.

I can’t be sure about this, but I think the 2nd argument to increment is what you need.

local DataStore2 = require(1936396537)

script.Parent.Triggered:Connect(function(plr)
    local TokenDataStore = DataStore2("Tokens", plr)
    TokenDataStore:Increment(Value, 10)
    script.Parent.Parent:Destroy()
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.