I made a door and a script to open and close it using TweenService but then I realized the door was made on the vector(0,0,0) but I need it to be (-90,0,0). Whenever I click to open the door, it goes back to its old vector. Is there any way I can change the orientation without actually rotating it or is there a code for it? If there is, please help me add it to the script:
local Door = script.Parent
local TweenService = game:GetService("TweenService")
local TweenStyle = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out,0,false,0)
local DoorOpen = {CFrame = CFrame.new(139.771, 71.004, 13.057)}
local DoorClose = {CFrame = CFrame.new(139.771, 71.004, 17.057)}
local OpenTween = TweenService:Create(Door,TweenStyle,DoorOpen)
local CloseTween = TweenService:Create(Door,TweenStyle,DoorClose)
click = script.Parent.click
debounce = false
click.MouseClick:Connect(function()
if debounce == false then --open
debounce = true
OpenTween:Play()
else
CloseTween:Play() --close
debounce = false
end
end)
Thank you so much.

1 comment
Thank you, it works. <3