--[[
Creats a beam between two parts.	
--]]

local function JoinPartsAtOffset(Part1,Part2,Offset1,Offset2,Rotation,Width1,Width2)
	--Create the attachments.
	local Attachment1 = Instance.new("Attachment")
	Attachment1.Position = Offset1
	Attachment1.Orientation = Rotation
	Attachment1.Parent = Part1
	
	local Attachment2 = Instance.new("Attachment")
	Attachment2.Position = Offset2
	Attachment2.Orientation = Rotation
	Attachment2.Parent = Part2
	
	--Create the beam.
	local Beam = Instance.new("Beam")
	Beam.Color = ColorSequence.new(Part1.Color,Part2.Color)
	Beam.Transparency = NumberSequence.new(Part1.Transparency,Part2.Transparency)
	Beam.LightInfluence = 1
	Beam.Attachment0 = Attachment1
	Beam.Attachment1 = Attachment2
	Beam.Width0 = Width1
	Beam.Width1 = Width2
	Beam.Parent = Part1
end
