please note I want this done to be with the least amount of lines used as possible, I understand theres an easy solution using a straight-forward method to do this otherwise.
player = game.Players.LocalPlayer
char = player.Character
backpack = player.Backpack
tools = game.Lighting.Tools:GetChildren()
part = game.Workspace.Part
part.Touched:connect(function()
for i, v in pairs(tools) do
local numbers = math.random(1, #tools)
if v == v[I] then
v:clone()
v.Parent = backpack
end
end
end)
so clearly that wouldn't work, so what is the simplest way (or best way) to take an object from a table, based on its index within the table? for example, I have a math.random call. for the number it picks out, I want that to determine which object will be selected (using that objects index in relation to the number)

2 comments
You don't use numbers there and I is not defined. Please reconsider what your pseudocode is trying to describe.
yeah sorry, i was a bit lazy when i wrote this