Proximity Sliding Door for a Lobby thumbnail
0 views0 copies0 likes

Proximity Sliding Door for a Lobby

Universal script

Copy it, then test it in your own Studio place.

Utilities Verified

Script code

21 lines · 0.6 KB
Download
local TweenService = game:GetService("TweenService")local door = workspace:WaitForChild("LobbyDoor")local panel = workspace:WaitForChild("DoorPanel")local closed = door.CFramelocal open = closed * CFrame.new(6, 0, 0)local prompt = Instance.new("ProximityPrompt", panel)prompt.ActionText = "Open door"local busy = falselocal function move(goal)	local tween = TweenService:Create(door, TweenInfo.new(0.55), {CFrame = goal})	tween:Play()	tween.Completed:Wait()endprompt.Triggered:Connect(function()-- …open Get script for the full source

About this script

Add two anchored parts to Workspace called LobbyDoor and DoorPanel. The prompt on the panel slides the door six studs along its local X axis, holds it for two seconds and returns it gently. The busy lock keeps multiple visitors from interrupting the movement. Leave enough clearance for the opened door, and tune the direction or travel distance to match the doorway.

Comments

Share what works, ask questions, or report an issue.

0

Log in to leave a comment.

No comments yet

Be the first to share your thoughts!

Raw Luau source

local TweenService = game:GetService("TweenService")
local door = workspace:WaitForChild("LobbyDoor")
local panel = workspace:WaitForChild("DoorPanel")
local closed = door.CFrame
local open = closed * CFrame.new(6, 0, 0)
local prompt = Instance.new("ProximityPrompt", panel)
prompt.ActionText = "Open door"
local busy = false
local function move(goal)
	local tween = TweenService:Create(door, TweenInfo.new(0.55), {CFrame = goal})
	tween:Play()
	tween.Completed:Wait()
end
prompt.Triggered:Connect(function()
	if busy then return end
	busy = true
	move(open)
	task.wait(2)
	move(closed)
	busy = false
end)