Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can I use .CFrame and/or .Position on Tables?

Asked by 5 years ago

Need a little help on this one. I'm assuming this isn't working because of my horrendous attempts at making a few tables out of this clutter but if there is another issue please help a guy out :) Note: I am unaware if I can use .Position or .CFrame on a table

local OutsideHandle = script.Parent.OutsideHandle
local InsideHandle = script.Parent.InsideHandle
local Frame = script.Parent.Frame
local Door = {"OutsideHandle", "InsideHandle", "Frame"}

local OpenInsideHandle = script.Parent.OpenObjective.OpenInsideHandle
local OpenOutsideHandle = script.Parent.OpenObjective.OpenOutsideHandle
local Open = script.Parent.OpenObjective.Open
local OpenObjective = {"OpenOutsideHandle", "OpenInsideHandle", "Open"}

local ClosedInsideHandle = script.Parent.ClosedObjective.ClosedInsideHandle
local ClosedOutsideHandle = script.Parent.ClosedObjective.ClosedOutsideHandle
local Closed = script.Parent.ClosedObjective.Closed
local ClosedObjective = {"ClosedInsideHandle", "ClosedOutsideHandle", "Closed"}

local Click = Instance.new("ClickDetector",script.Parent.Frame)
Click.MaxActivationDistance = 10

Click.MouseClick:Connect(function()
    if Door.Position == ClosedObjective.Position then
        Door.Position = OpenObjective.Position
        Door.CFrame = Door.CFrame * CFrame.Angles(0, 0, math.rad(-100))
        print("Door opened")
    else
        Door.Position = OpenObjective.Position
        Door.Position = ClosedObjective.Position
        Door.CFrame = Door.CFrame * CFrame.Angles(0, 0, 0)
        print("Door closed")
    end
end)
0
u cant Gey4Jesus69 2705 — 5y
0
Ok thx OrangeJooz 22 — 5y
0
Technically you can but it would be a rather inefficient method EpicMetatableMoment 1444 — 5y

Answer this question