What do you want to achieve? Keep it simple and clear!
I want to be able to set a specific player certain points via DataStoreService using SetAsync() or UpdateAsync()
What is the issue?
literally doesn’t work but instead breaks the leaderstats
Players.PlayerAdded(function(player)
local ID = 66666666
local data = player.leaderstats.Time
local success, errormessage = pcall(function()
PointsDataStorage:SetAsync(ID, data.Value == 55555)
end)
end)
To answer your question yes. If you have the Key for the player you can change the data how ever you want in this case the key would be local ID = 66666666
What i expected to see (just vaguely resembling this not 1 to 1)
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
local LeaderStatsFolder = Instance.new("Folder")
LeaderStatsFolder.Name = "leaderstats"
LeaderStatsFolder.Parent = Player
local Time = Instance.new("NumberValue")
Time.Name = "Time"
Time.Parent = LeaderStatsFolder
local Key = Player.UserID
local success, errormessage = pcall(function()
PointsDataStorage:SetAsync(Key, Data being stored)
end)
end)
This is just a vague example it works… just isn’t something you want to use without fixing ofc