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

how do you do something to every value in a table?

basically trying to clone everything in one table. how would I do that?

local ServerStorage = game:GetService("ServerStorage")
local crates = ServerStorage.Guns:GetChildren()

while true do
	crates[1].Clone()
	
	wait(5)
end

1 comment

0

ServerStorage.Guns:Clone(), clones the children too

1 answer

✓ Accepted answer

What we'd do here is loop through them and check them, after that we can do whatever we want

local ServerStorage = game:GetService("ServerStorage")
local crates = ServerStorage.Guns:GetChildren()

for i,v in pairs(crates) do
    local Item = crates[i].Clone()
	print("Cloned item"..crates[i].Name)
	Item.Parent = workspace
    wait(5)
end

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