--The "tele1" brick takes you to "tele2".


debounce = false

function onTouched(hit)
	if debounce then return else debounce = true end
	if hit.Parent:FindFirstChild("Humanoid") then
		local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
		if player then
			
			local gui = Instance.new("ScreenGui", player.PlayerGui)
			local label = Instance.new("TextLabel", gui)
			label.Size = UDim2.new(2, 0, 2, 0)
			label.Position = UDim2.new(-0.5, 0, -0.5, 0)
			label.BackgroundColor3 = Color3.new(0,0,0)
			label.BackgroundTransparency = 1
			label.Text = ""
			while gui and label and label.BackgroundTransparency > 0 do
				wait()
				label.BackgroundTransparency = label.BackgroundTransparency - 0.1
			end
			if hit then
				hit.Parent:MoveTo(script.Parent.tele2.Position)
			end
wait (0)
			while gui and label and label.BackgroundTransparency < 1 do
				wait()
				label.BackgroundTransparency = label.BackgroundTransparency + 0.1
			end
			if gui then
				gui:Remove()
			end

				end
			end
	debounce = false
end

script.Parent.tele1.Touched:connect(onTouched)
