I’m trying to make a door using proximity prompt. My issue is the door will not close. The door uses RemoteEvents to work because tweening is smoother on the client.
local open = false
script.Parent.Triggered:Connect(function()
-------problematic------------------------------------------------------
game.ReplicatedStorage.Door_Action:FireAllClients(open, script.Parent)
------------------------------------------------------------------------
if open == false then
print("opening")
open = true
script.Parent.Enabled = false
-- won't run unless remoteEvent line is removed ---------------------------
elseif open == true then
print("closing")
open = false
script.Parent.Enabled = false
end
---------------------------------------------------------------------------
wait(2)
script.Parent.Enabled = true
end)
The elseif statement will not run when I trigger the prompt a second time. It only seems to run the elseif statement when I remove the FireAllClients line.
I tried looking for someone with a similar problem to no avail. Does anyone know why this is happening??