i tried to make a leaderstats but it did not work, it said "string expected, got table", what does that means?
✓ ANSWER ACCEPTED
string expected, got table, what does that mean?
2 answers
✓ Accepted answer
This is how you properly create leaderstats. Not sure if this is what you were referring to since your question was vague.
--CODE
--DO NOT FORGET TO DEFINE WHO THE PLAYER IS!!
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"
That means you passed or put in table instead of string -- table is something like (cat, dog, lizard), containing several values. String is something typed in words - like "Hello, I am Lukas".
You may accidentally used wrong variable, which contains table instead of string. If you requested it from data store it will return it in table form, that means you will need to access it in that way:
for i, v in pairs(table) do
-- table is {cat, dog, lizard}
print(v)
end
-- output - cat dog lizard
1 comment
0
ok but i told you i made a leaderstat
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Please notify me on discord if you have extra questions :) thomas!#5374