Untitled

mail@pastecode.io avatarunknown
plain_text
a month ago
612 B
1
Indexable
Never
local Part = script.Parent
local Right = workspace.right
local Left = workspace.left


local function Open(player)
	if (player.Parent:FindFirstChild("Humanoid")) then
		for i = 1,20 do
			wait()
			Right.Position -= Vector3.new(0,0,0.05)
			Left.Position += Vector3.new(0,0,0.05)
		end
		wait(1)
	end
end

local function Close(player)
	if (player.Parent:FindFirstChild("Humanoid")) then
		for i = 1,20 do
			wait()
			Right.Position += Vector3.new(0,0,0.05)
			Left.Position -= Vector3.new(0,0,0.05)
		end
		wait(1)
		end
end

Part.Touched:Connect(Open)
Part.TouchEnded:Connect(Close)