Hello, I wanted to switch over to Profile Service, because I have found it makes life easier for me, and is more reliable than Datastore2.
I watched a video on youtube, and now I can understand it better.
What I need help with, is to turn the tables I have into NumberValue Instances under a player “Statsfolder” so it is easier for me to update the information to the client.
Instead of doing them all individually, is there a way to do it in a “For” script?
Also, would this make it unstable somehow? Should I just dedicate to doing it manually one by one?
As you can see, I tried to do v.Name for the stored Data.Name, but it didn’t work.
Is there some other way of referencing the data’s name to make sure each one gets its own proper instance?
local level = Instance.new("NumberValue", leaderstats)
level.Name = "Level"
level.Value = profile.Data.Status.Level
for _, v in pairs(profile.Data.Status) do
if statsfolder:FindFirstChild(v.Name) == nil then
local stat = Instance.new("NumberValue", statsfolder)
stat.Name = v.Name
stat.Value = v
end
end
The reason for this, is that I was considering running a :GetPropertyChangedSignal(“Value”):Connect(function()
On each value, so the Player GUI can update client sided, without me needing to run a while wait() loop over and over again.
Is there another method of doing this as well?