Profile service data looking problem

Hello developer! I am currently making an ability backpack for my game and I am making it away so it’s way easier to make new ability! I am using a profile service to store my data and I want to look up certain data but I don’t want to do player profile.Data.DataExemple but I want to do like for example

local AbilityName = script.Parent.AbilityName.Value
local AbilityData = playerProfile.Data:WaitForChild(AbilityName)

but I can’t find a good function to look up for the data so if you know the function name pls tell me!

You can’t WaitForChild on a table since… it’s a table and not an instance.

Just do local AbilityData = playerProfile.Data[AbilityName]

1 Like

You can use Instances to hold data if you want and have them still save to ProfileService easily

local numberValue = Instance.new("NumberValue")

numberValue.Value = Profile.Data.NiceNumber

numberValue.Changed:Connect(function()
    Profile.Data.NiceNumber = numberValue.Value
end)
1 Like

thank you it work! :smiley: a big thank for you!

1 Like