Trying to make a elevator door tween that moves when the proximity prompt is triggered. I’ve been struggling with how the cframes work and no matter what I do, it goes to the debugging screen.
-- door original position = -140.075, -8.6, -481.725
-- door new position (cframe) = {-140.075, -23.35, -481.725}, {0, 90, 0}
local prompt = script.Parent
local keycardReader = script.Parent.Parent
local keycardReaderColor = script.Parent.Parent.ColorChange
local largeDoor = game.Workspace.largeElevatorDoor1
local largeElevatorDoorCurrentlyOpening = game.ReplicatedStorage.largeElevatorDoorCurrentlyOpening
local largeElevatorDoorOpen = game.ReplicatedStorage.largeElevatorDoorOpen
local TweenService = game:GetService("TweenService")
local function doorOpen()
largeElevatorDoorCurrentlyOpening.Value = true
keycardReaderColor.Color = Color3.fromRGB(255, 0, 0)
TweenService:Create(
largeDoor,
TweenInfo.new(
4,
Enum.EasingStyle.Sine,
Enum.EasingDirection.InOut,
0,
false,
0
),
{CFrame = {-140.075, -23.35, -481.725}, {0, 90, 0}}
):Play()
end
prompt.Triggered:Connect(function()
doorOpen()
end)
Any help with this would be greatly appreciated.