I have this door script here,
local TweenService = game:GetService("TweenService")
local cd = false
local hinge = script.Parent.Hinge
local prompt = script.Parent.Door.ProximityPrompt
local goalOpen = {}
goalOpen.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(90), 0)
local goalClose = {}
goalClose.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0)
local tweenInfo = TweenInfo.new(1)
local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen)
local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose)
prompt.Triggered:Connect(function()
if prompt.ActionText == "Close" then
if cd == false then
cd = true
tweenClose:Play()
script.Parent.Door.ProximityPrompt.Enabled = false
wait (2)
cd = false
prompt.ActionText = "Open"
script.Parent.Door.ProximityPrompt.Enabled = true
end
else
if cd == false then
tweenOpen:Play()
cd = true
script.Parent.Door.ProximityPrompt.Enabled = false
prompt.ActionText = "Close"
wait (2)
script.Parent.Door.ProximityPrompt.Enabled = true
cd = false
end
end
end)
And for some reason I just cant figure out when I open it how to make it go up instead of going on the x axis