function getDataValue(Player, Value)
local Profile = Profiles[Player]
if not Profile then return end
return Profile.Data[Value]
end
GetData.OnServerInvoke = getDataValue
and this LocalScript
local Remotes = game:GetService(“ReplicatedStorage”):WaitForChild(“Remotes”)
task.wait(5)
local Money = Remotes.GetDataValue:InvokeServer(game.Players.LocalPlayer, “Money”)
script.Parent.Text = tostring(Money)
The thing is, I don’t know how to get the player’s money. If I do Profile.Data.Money with the player’s profile, it returns the right value, but in the LocalScript, the value is just nil, so how do I get a specific data value from a LocalScript?
I need to return Profile.Data[Value] to the client, because I want to have a function to get my data-values. I don’t want to have a function for every value and then return e.g Profile.Data.Money