So, I’ve been trying to make profile GUI’s which display a player’s stats, like their Level or Experience.
The thing is, I have no idea how to retrieve an offline player’s data/values.
How would I get the values inside a folder, located inside a player from DataStore?
local dss = game:GetService("DataStoreService")
local levelDS = dss:GetDataStore("Levels")
local PlayerService = game:GetService("Players")
function getData(player)
pcall(function()
local level = player.Stats.Level.Value
local exp = player.Stats.Experience.Value
levelDS:GetAsync(PlayerService:GetUserIdFromNameAsync(script.Parent.NameContainer.Name_1.Text) .. "Level", {level, exp})
script.Parent.ShowStuff.Text = exp
end)
end
wait(5)
getData()
This is what I’ve tried, this script gets the UserId using a textlabel with a player’s username, which then tries to get their Stats/Values.
I want to know how I could get a player’s stats/values and display them on textlabels.
If the script above doesn’t make any sense, then its because I don’t know what I am doing.