How do you pass a value from a dictionary from DataStore2 to the client?

Hi so pretty self explanatory:

CLIENT

for i,v in ipairs(OutfitsFrame.ScrollingFrame:GetChildren()) do
	if v:IsA("Frame") then
		local Outfit = game:GetService("ReplicatedStorage").PlayerCustomization:InvokeServer("LoadOutfits", v.Name)
		v.TextLabel.Text = Outfit
	end
end

SERVER

	elseif action == "LoadOutfits" then
		local OutfitName = Datastore2(Id, player):Get(Outfit)
		print(OutfitName.Slot)
		local name = tostring(Outfit.Slot)
		return name

I’ve tried many different methods but the outcome is always the same, when I print Outfit.Slot on the server in this function above, it prints the string how it should, yet on the client it prints the table Id and I get the error bad argument #3, string expected got table for the v.TextLabel.Text line.

Any help is appreciated, this is DataStore2 by the way, I’m sure there is a simple answer to this but I can’t understand what I’m doing wrong. :sweat:

You are returning Outfit.Slot which i suspect is a Table where as you should be returning OutfitName.Slot

2 Likes

BLESS YOUR SOUL GOOD SIR
thanks lol

2 Likes