Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Solved]Values Not Copying Over?

Asked by 4 years ago
Edited 4 years ago

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.

0
Instead of using Instance.new and copying everything, you can just use :Clone() and parent it to NewData Nguyenlegiahung 1091 — 4y
0
i tried that at first but the same problem happened kie1605 0 — 4y
0
Stupid question but... Is the stat value is 0 ? Nguyenlegiahung 1091 — 4y
0
the number values are but the string values are empty kie1605 0 — 4y
View all comments (2 more)
0
the string values should say "None" kie1605 0 — 4y
0
ok i figured it out kie1605 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Ok, i just did it in a local script and it worked

Ad

Answer this question