Hey everyone, it seems im getting an error from this datastore script this is a part of it, and here is the error im getting, if u could help me i would really appreciate it, thank you.
– Error
invalid argument #1 to 'pairs' (table expected, got Instance)
– Script
local function create_table(plr)
local player_stats = {}
for _, stat in pairs(plr.PlayerDataFolder.PlayerBasket) do --The error is on this line
player_stats[stat.Name] = stat.Value
end
return player_stats
end