Press E to Open Door

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.

1 Like

Honestly, I am not a scripter (on roblox lua) but, this might help. I hope it helps! Pray to the gods, haha!


It’s about vertical hinge for doors, made by roblox!

Edit: Please like and mark as solution if works. Thanks!

1 Like

It wasn’t really a hinge door, I don’t know if I should add a hinge to make it work. Anyways, thank you. :slight_smile:

Sorry, if it didn’t help, just trying to help the community. :slight_smile:

1 Like

In addition to the resources @TakingLegs provided, I would also check out this awesome tutorial that colbert2677 made.

1 Like

Ohhh, I forgot about TweenService, stupid me.

1 Like