Basically, everything is working fine, the door moves and etc, however, I have no idea on how to make the door rotate. It only moves to where it was supposed to be, but I don’t know how to make it turn 0,155,0. Here is the script I am using right now:
open = false
local ToolEvent = game.Lighting.OpenDoor
local TweenService = game:GetService("TweenService")
local door1 = workspace.doortest
local tweeningInformation = TweenInfo.new(
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local originalCFrame = door1.CFrame
local door1Open = {CFrame = originalCFrame * CFrame.new(-4.859, 0, -4.915)}
local door1Close = {CFrame = originalCFrame}
local tween1open = TweenService:Create(door1,tweeningInformation,door1Open)
local tween1close = TweenService:Create(door1,tweeningInformation,door1Close)
ToolEvent.OnServerEvent:Connect(function(player)
if open == false then
open = true
workspace.testdoor.Gui.Enabled = false
tween1open:Play()
wait(4)
tween1close:Play()
wait(1)
workspace.testdoor.Gui.Enabled = true
open = false
end
end)
The only thing I need help with is how to make it rotate, thank you.
If that’s important, the door goes from position -3, 4.175, 24 to -7.859, 4.175, 20.915.