0 views0 copies0 likes

Timed Gate Sequence for Training Rooms

Universal script

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

Utilities Verified

Script code

22 lines ยท 0.7 KB
Download
local folder = workspace:WaitForChild("TrainingGates")local prompt = Instance.new("ProximityPrompt", workspace:WaitForChild("GateControl"))prompt.ActionText = "Start gates"local busy = falseprompt.Triggered:Connect(function()	if busy then return end	busy = true	local parts = folder:GetChildren()	table.sort(parts, function(a, b) return a.Name < b.Name end)	local saved = {}	for _, part in parts do		if not part:IsA("BasePart") then continue end		saved[part] = {part.Transparency, part.CanCollide}		part.Transparency, part.CanCollide = 0.8, false-- โ€ฆopen Get script for the full source

About this script

Put anchored gate parts inside Workspace.TrainingGates with names such as 01, 02 and 03, and add an anchored GateControl part. Pulling the prompt opens each gate in order. All gates close together after the course window, and the control ignores repeat input while the sequence runs. Test the timing with your actual travel distances, leaving plenty of room near the closing gates.

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 folder = workspace:WaitForChild("TrainingGates")
local prompt = Instance.new("ProximityPrompt", workspace:WaitForChild("GateControl"))
prompt.ActionText = "Start gates"
local busy = false
prompt.Triggered:Connect(function()
	if busy then return end
	busy = true
	local parts = folder:GetChildren()
	table.sort(parts, function(a, b) return a.Name < b.Name end)
	local saved = {}
	for _, part in parts do
		if not part:IsA("BasePart") then continue end
		saved[part] = {part.Transparency, part.CanCollide}
		part.Transparency, part.CanCollide = 0.8, false
		task.wait(1)
	end
	task.wait(5)
	for part, state in saved do
		if part.Parent then part.Transparency, part.CanCollide = state[1], state[2] end
	end
	busy = false
end)