x=script.Parent table1={script.Parent:GetChildren()} button=script.Parent.button debounce=true button.Touched:connect(function(onTouch) if debounce==true then debounce=false for i=1,10 do for o,p in pairs(table1) do p.CFrame=CFrame.new(p.CFrame.x+1,p.CFrame.y,p.CFrame.z) wait(2) end end end debounce=true end)
I want to make everything in the script's parent move, but when I do this, it says: Workspace.buildingright.Script:11: attempt to index field 'CFrame' (a nil value) I don't know what else to try.. Help would be appreciated
The GetChildren
method returns a table, so there is no reason to put it in another table. Replace line 2 with this:
table1 = script.Parent:GetChildren()