So i have 2 parts in a model named Part1 and Part2. I inserted part1 into a table, so how can i use that part from the table on other things.
db = false
touch = script.Parent
model = touch.Parent
allparts = model:GetChildren()
tab = {}
touch.Touched:Connect(function()
if db == false then
db = true
for i,v in pairs(allparts)do
if v.name == "Part1" then
table.insert(tab,model.Part1)
for i = 1,20 do
tab[1].CFrame = tab[1].CFrame * Vector3.new(0,0.05,0) --Error
wait()
end
print(tab[1])
end
end
db = false
end
end)
it's saying tab[1] won't work in line 14, even though in my mind it's litterly the same thing as Part1, so i just want to take out "Part1" in the table and make it into a variable.

4 comments
Any Errors? If so tell me the error
The error is that in line 14 tab[1] is equal to saying Part1, but it's not working. so the part isn't moving.
Dude why do you have a for loop and you aren't even using it. Like "i = 1,20" but in the actual loop i cannot see an "i"
The loop is for the CFrame inside the loop, guy.