local TweenService = game:GetService("TweenService")
local hinge = script.Parent.Doorframe.Hinge
local prompt = script.Parent.Base.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
tweenClose:Play()
prompt.ActionText = "Open"
else
tweenOpen:Play()
prompt.ActionText = "Close"
end
end)
COMMUNITY QUESTION
How Can i add sound to door when i open? (using ProximtityPrompt)
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
add a close sound and open sound and put it into the script. Then make a variable of the two, name it whatever you want. in the connect:function(), closeSound:Play() if it is open and openSound:Play() if it is closed