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

Why do i have an error for DataToSave saying (Expected identifier when parsing expression, got '{')?

local DataToSave {}

for _, Stat in pairs(Stats1:GetChildren()) do
	table.insert(DataToSave, Stat.Value)
	warn("Player Left, Saving " .. Stat.Name .. " | " .. Stat.Value)
end
for _, Stat in pairs(Stats2:GetChildren()) do
	table.insert(DataToSave, Stat.Value)
	warn("Player Left, Saving " .. Stat.Name .. " | " .. Stat.Value)
end

PDS:SetAsync(Key, DataTo Save)

end)

1 comment

0

i found the answer hopefully

1 answer

✓ Accepted answer
local DataToSave = {}
for _, Stat in pairs(Stats1:GetChildren()) do
    table.insert(DataToSave, Stat.Value)
    warn("Player Left, Saving " .. Stat.Name .. " | " .. Stat.Value)
end
for _, Stat in pairs(Stats2:GetChildren()) do
    table.insert(DataToSave, Stat.Value)
    warn("Player Left, Saving " .. Stat.Name .. " | " .. Stat.Value)
end

PDS:SetAsync(Key, DataToSave)

6 comments

0

oh

0

end)

0

You Forgot at line 1 the =

0

and in line 11 you wrote DataTo Save but its DataToSave

0

ty

0

no problem :D

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