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

Why do not the data load correctly? [SOLVED]

Asked by 5 years ago
Edited 5 years ago

function inputDataToPlayer(player, dataTable) if dataTable ~= nil then for alldata,currentdata in pairs (dataTable) do local Part = game.ServerStorage.Part:Clone() Part.Parent = game.Workspace.PlayerBase.Objects Part.Name = (currentdata["Name"]) Part.Position = (Vector3.new( currentdata["PositionX"],currentdata["PositionY"],currentdata["PositionZ"])) Part.BrickColor = (BrickColor.new((currentdata["Color"]))) Part.Material = (string.sub(currentdata["Material"],15,-1)) print (string.sub(currentdata["Material"],15,-1)) end end

I fixed it!

for some reason i cant create a Vector3 out of one Position Value i have to use PositionX,Y and Z

0
When you do variable = 1, 2, 3. The '2, 3' are discarded, and variable is assigned to 1. User#19524 175 — 5y
0
just use vector3 and color3 values for color and position theking48989987 2147 — 5y
0
You cannot store userdata in data stores. Or maybe not directly, however I don't think you can at all User#19524 175 — 5y

1 answer

Log in to vote
0
Answered by
Leamir 3138 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

Hello again, MageMasterHD!

You don't need to do nothing with the datas(if you didn't changed the script)

function inputDataToPlayer(player, dataTable)
    if dataTable ~= nil then

    for data,currentdata in pairs (dataTable) do
        local Part = game.ServerStorage.Part:Clone()
        Part.Parent = game.Workspace.PlayerBase.Objects
        Part.Name = currentdata[data]["Name"] --This is a String
        Part.Position = currentdata[data]["Position"] --This is a Vector3
        Part.Color = currentdata[data]["Color"] --This is a Color3
        Part.Material = currentdata[data]["Material"] --This is a Material
    end

end

You also forgot to add the index...

Next question, please add all the scripts related to it, like the data saving one

Good Luck with your games

0
it tells me (Vector3 expected, got string) MageMasterHD 261 — 5y
Ad

Answer this question