I have created 4 separate tables to hold the values for open and close on my tweenservice door and i’m wondering
if theirs a way for me to do this in only 1 table.
local bottomOpen = {}
bottomOpen.CFrame = bottomDoor.CFrame + Vector3.new(0,-2,0)
local bottomClosed = {}
bottomClosed.CFrame = bottomDoor.CFrame
local topOpen = {}
topOpen.CFrame = topDoor.CFrame + Vector3.new(0,5,0)
local topClosed = {}
topClosed.CFrame = topDoor.CFrame
In your code with 4 tables, each table is a dictionary with only 1 value, where the key name is “CFrame”, and the value is the CFrame
You could get rid of every table and replace it with a simple variable, as only 1 value is stored in each table, or as Jonah suggested, you can give a unique name to each CFrame to be able to store all of them in a single table. You’ll then have to use a pairs() loop onto that table if you want to avoid manually indexing every value. (or no iterator, as that is now possible)
doors.ClickDetector.MouseClick:Connect(function()
if Activated == false then
local openBottom = tweenService:Create(bottomDoor,tweenInfo,doorCFrames.bottomOpen)