Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[Solved]Values Not Copying Over?

Yes, so i'm making a Datastore where I am copying Values from a pre-made folder and sending them over to the Player, the problem is that the Values wont copy, the names do but not the Values?

local function NewPlayerData(player)
	local NewData = Instance.new("Folder", player)
	NewData.Name = "PlayerData"
	
	for _, Stats in pairs(script.PlayerData:GetChildren()) do
		local NewStats = Instance.new(Stats.ClassName, NewData)
		NewStats.Name = Stats.Name
		NewStats.Value = Stats.Value
	end
end

the function is called when the player joins.

6 comments

0

Instead of using Instance.new and copying everything, you can just use :Clone() and parent it to NewData

0

i tried that at first but the same problem happened

0

Stupid question but... Is the stat value is 0 ?

0

the number values are but the string values are empty

0

the string values should say "None"

0

ok i figured it out

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.