local PlayerJoined_DataStore = game:GetService('DataStoreService'):GetDataStore('JoinedTimes') game.Players.PlayerAdded:connect(function(Player) local Joined = PlayerJoined_DataStore:GetAsync(tostring(Player.UserId)) local Stats = Instance.new('Folder',Player) Stats.Name = 'leaderstats' local JoinStat = Instance.new('NumberValue',Stats) JoinStat.Name = 'Joined' if Joined ~= nil or Joined == 0 then JoinStat.Value = Joined print("Loaded stats for "..Player.Name) PlayerJoined_DataStore:SetAsync(tostring(Player.UserId), Joined + 1) --[[ I would like to GetAsync data for the player kill value. I have already made a leaderboard script with the value I want to save, the directory of the value I want to save is game.Players.PLRNAME.leaderstats.Kills.Value --]] else PlayerJoined_DataStore:SetAsync(tonumber(Player.UserId), 1) warn("Failed to load stats for"..Player.Name) end end)
Ignore the "local VALUE =" with an empty definition of the line, look below the line to see what I defined the VALUE to be.
I would imagine that all you need to do is create a new data store:
local kills_ds = game:GetService('DataStoreService'):GetDataStore('Kills') game.Players.PlayerRemoving:Connect(function(player) kills_ds:SetAsync(player.UserId,player.leaderstats.Kills.Value) end