Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help How to make it return to its og position?

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 answer

✓ Accepted answer

Set the value of its position at the beginning so you have its original position. Original Post = part.position. yeah?

1 comment

0

thx a lot

This discussion is preserved as it was. New answers, comments, and votes are closed.