It doesn't print all the player's accessories in the output and it makes me sad :(
local script:
local tab = {}
for i,v in pairs (game.Players.LocalPlayer.Character:GetChildren()) do if v:IsA("Accessory") then table.insert(tab,v.Name) end end
for i = 1,#tab do print(tab[i]) end
Hello, You should always format your code using a code block, it makes it easier to see.
There's a few things wrong. You're most likely trying to run the script before the player's Character is loaded. You should use the same kind of for loop you used to make "tab" with printing tab, because you're only printing the number of the value of tab.
Here's how you can fix it:
local tab = {} local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:wait() for i,v in pairs (character:GetChildren()) do if v:IsA("Accessory") then table.insert(tab,v.Name) end end for i, v in pairs(tab) do print(v) end