function LaserRenderer.createLaser(Z,Q)local A=Z.Position local F=(A-Q).Magnitude local b=CFrame.lookAt(A,Q)*CFrame.new(0,0,-F/2)local q=Instance.new("\080\097\114\116")q.Size=Vector3.new(.2,.2,F)q.CFrame=b q.Anchored=true q.CanCollide=false q.Color=Color3.fromRGB(255,0,0)q.Material=Enum.Material.Neon q.Parent=workspace game.Debris:AddItem(q,SHOT_DURATION)local U=Z:FindFirstChild("\065\099\116\105\118\097\116\101")if U then U:Play()end end return LaserRenderer
-- Create a laser beam from a start position towards an end position
function LaserRenderer.createLaser(toolHandle, endPosition)
	local startPosition = toolHandle.Position

	local laserDistance = (startPosition - endPosition).Magnitude
	local laserCFrame = CFrame.lookAt(startPosition, endPosition) * CFrame.new(0, 0, -laserDistance / 2)

	local laserPart = Instance.new("Part")
	laserPart.Size = Vector3.new(0.2, 0.2, laserDistance)
	laserPart.CFrame = laserCFrame
	laserPart.Anchored = true
	laserPart.CanCollide = false
	laserPart.Color = Color3.fromRGB(255, 0, 0)
	laserPart.Material = Enum.Material.Neon
	laserPart.Parent = workspace

	-- Add laser beam to the Debris service to be removed & cleaned up
	game.Debris:AddItem(laserPart, SHOT_DURATION)

	-- Play the weapon's shooting sound
	local shootingSound = toolHandle:FindFirstChild("Activate")
	if shootingSound then
		shootingSound:Play()
	end
end

return LaserRenderer
