Hi, Im trying to make my door not go up and down at the same time when someone walks through it.
Heres what it does https://streamable.com/caq3rn
The script is
local door = script.Parent:WaitForChild("Door")
local sensor1 = script.Parent:WaitForChild("Sensor1")
local sensor2 = script.Parent:WaitForChild("Sensor2")
local noise = door:FindFirstChild("Noise")
doorOpen = false
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(1.79, Enum.EasingStyle.Linear, Enum.EasingDirection.In,0,false,0)
local doorPos1 = {CFrame = CFrame.new(-68.683, 10.023, -53.5)}
local doorPos2 = {CFrame = CFrame.new(-68.683, 3.25, -53.5)}
local open = tweenService:Create(door,tweenInfo,doorPos1)
local close = tweenService:Create(door,tweenInfo,doorPos2)
sensor1.Touched:Connect(function()
if doorOpen == false then
open:Play()
wait(3.3)
doorOpen = true
wait(3.3)
close:Play()
end
end)
sensor2.Touched:Connect(function()
if doorOpen == true then
open:Play()
wait(3.3)
doorOpen = false
wait(3.3)
close:Play()
end
end)
If anyone can help I would appreciate it