GetChildren() table not printing

local attacks = game.ServerStorage:WaitForChild("attackFolder"):GetChildren()
print(unpack(attacks))

I am trying to get it to print everything within the “attackFolder”, yet nothing prints in the console. Script is being called as a server script from ServerScriptService

Should be:

print(table.unpack(attacks))
1 Like

As Censor said, it needs to be
print(table.unpack(attacks))

Otherwise, it won’t understand what ‘Unpack’ means

1 Like

Native ‘Lua’ and by deduction ‘Luau’ provide a global function named ‘unpack’ as part of their ‘Basic’ library. Its semantics are shared with the table library function of the same name.

image

The lack of an output indicates that the folder is empty when the code is ran.

Both table.unpack and unpack works, add a wait(1) before running the function and see if that works.