Hey there, I’m new to posting here. But maybe I’m overlooking something, what is causing this door to not open whenever you ‘attempt’ to open it whenever it’s locked?
Example of issue
Code
-- Functions --
local function DoorLock()
if Locked == true then
ProxPrompt2.ActionText = 'Lock Door'
print('Locked Door')
Locked = false
LockSound:Play()
print(Locked)
else
ProxPrompt2.ActionText = 'Unlock Door'
print('Unlocked Door')
Locked = true
LockSound:Play()
print(Locked)
end
end
local function DoorFunction()
if debounce == true then
debounce = false
if Locked == false then
if IsOpened == true then
ProxPrompt.ActionText = 'Open Door'
IsOpened = false
CloseSound:Play()
tweenService:Create(Frame,TweenInfo.new(0.65),{CFrame = DoorClose.CFrame}):Play()
tweenService:Create(Frame2,TweenInfo.new(0.65),{CFrame = HandleClose.CFrame}):Play()
else
IsOpened = true
ProxPrompt.ActionText = 'Close Door'
OpenSound:Play()
tweenService:Create(Frame,TweenInfo.new(0.65),{CFrame = DoorOpen.CFrame}):Play()
tweenService:Create(Frame2,TweenInfo.new(0.65),{CFrame = HandleOpen.CFrame}):Play()
end
wait(0.65)
debounce = true
end
else
LockedOpen:Play()
print('Door Is Locked')
end
end
ProxPrompt2.Triggered:Connect(DoorLock)
ProxPrompt.Triggered:Connect(DoorFunction)
I don’t know if this is on my end, or this happens to be a bug. Again, extremely unsure if I’m looking something over or not. Please do let me know a fix, and why it’s fixed in the comments if possible.
Thank you for your time, I hope you had a wonderful Christmas!