--Crosshair module

local crosshair = {}

crosshair.crossscale = Physics.spring.new(0)	
crosshair.crossscale.s = 10	
crosshair.crossscale.d = 0.8
crosshair.crossscale.t = 1
crosshair.crossspring = Physics.spring.new(0)
crosshair.crossspring.s = 12
crosshair.crossspring.d = 0.65

local function updatecross()
	local size = crosshair.crossspring.p*4*crosshair.crossscale.p --*(char.speed/14*(1-0.8)*2+0.8)*(char.sprint+1)/2
	for i = 1, 4 do
		CrossParts[i].BackgroundTransparency = 1-size/20
	end
	CrossParts[1].Position = UDim2.new(0,size,0,0)
	CrossParts[2].Position = UDim2.new(0,-size-7,0,0)
	CrossParts[3].Position = UDim2.new(0,0,0,size)
	CrossParts[4].Position = UDim2.new(0,0,0,-size-7)
end

function crosshair:setcrossscale(scale)
	crosshair.crossscale.t = scale
end	
	
function crosshair:setcrosssize(size)
	crosshair.crossspring.t = size
end

function crosshair:setcrosssettings(size,speed,damper)
	crosshair.crossspring.t = size
	crosshair.crossspring.s = speed
	crosshair.crossspring.d = damper
end

game:GetService("RunService").RenderStepped:connect(function()
	updatecross()
end)

return crosshair
