Start building

Roblox ProximityPrompt Sliding Door Script (TweenService)

Creates a press-E ProximityPrompt on any anchored door Part and smoothly tweens it open and shut.

Type: ScriptExplorer: Inside your Door PartLevel: Beginner
ScriptInside your Door Part
-- Script inside an Anchored Door Part
local TweenService = game:GetService("TweenService")

local door = script.Parent :: BasePart
local closedCF = door.CFrame
local openCF = closedCF * CFrame.new(door.Size.X, 0, 0)
local isOpen = false
local busy = false

local prompt = Instance.new("ProximityPrompt")
prompt.ActionText = "Open"
prompt.ObjectText = "Door"
prompt.HoldDuration = 0
prompt.MaxActivationDistance = 10
prompt.Parent = door

prompt.Triggered:Connect(function()
	if busy then return end
	busy = true
	isOpen = not isOpen
	prompt.ActionText = if isOpen then "Close" else "Open"
	local tween = TweenService:Create(door, TweenInfo.new(0.6, Enum.EasingStyle.Quad), {
		CFrame = if isOpen then openCF else closedCF,
	})
	tween:Play()
	tween.Completed:Wait()
	busy = false
end)

How to install in Studio

  1. Create an Anchored door Part in Workspace.
  2. Insert a Script inside that Part and paste the code.
  3. Walk near the door in Playtest and press E to slide it open.

Tips & customization

  • Change `CFrame.new(door.Size.X, 0, 0)` to `CFrame.new(0, door.Size.Y, 0)` for a sci-fi vertical blast door.

Common questions.

Does ProximityPrompt work on mobile and console?

Yes! Roblox automatically shows a Tap prompt on mobile and a button icon on controller.

More free Luau scripts.

All 16 scripts

Skip manual wiring.
Let Revix code & playtest it.

Start building free

Free to start. No card needed.