i couldn't do this I tried for 3 hours now how do I make it return to its original position ignore the left door i didn't code it yet
script.Parent.OnTouch.Entrance.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local part = script.Parent.OnTouch.Part
local part2 = script.Parent.OnTouch.Part2
local RightDoor = script.Parent.DoorRight
local LeftDoor = script.Parent.DoorLeft
local DoorRightPos = script.Parent.DoorRightPos
local key = 0
for i = 0,1, .01 do
RightDoor.CFrame = RightDoor.CFrame:Lerp(part2.CFrame ,i)
wait(2)
if key == 1 then
break
end
wait(2)
key += 1
RightDoor.CFrame.Position = DoorRightPos.CFrame.Position
end
end
end)
its also not lerping

1 comment
thx a lot