function module.getSide(s,I)local c=s.CFrame if I.x>0 then return(c*CFrame.fromAxisAngle(Vector3.new(0,-1,0),math.pi/2)).lookVector elseif I.x<0 then return(c*CFrame.fromAxisAngle(Vector3.new(0,1,0),math.pi/2)).lookVector end if I.y<0 then return(c*CFrame.fromAxisAngle(Vector3.new(-1,0,0),math.pi/2)).lookVector elseif I.y>0 then return(c*CFrame.fromAxisAngle(Vector3.new(1,0,0),math.pi/2)).lookVector end if I.z<0 then return c.lookVector elseif I.z>0 then return-c.lookVector end end function module.debounce(s)local I=false return function(...)if not I then I=true s(...)I=false end end end function module.part(s)local I={}local function c(M)for M,e in pairs(M:GetChildren())do if e:IsA("\080\097\114\116")and e~=s then table.insert(I,#I+1,e)elseif e:IsA("\077\111\100\101\108")then c(e)end end end c(game.Workspace)local M={}for I,c in pairs(I)do local e=(c.Position-s.Position).magnitude if e<M[1]then M[1]=e M[2]=c end end return M[2]end function module.weld(s,I)local c=Instance.new("\087\101\108\100")c.Part0=s c.Part1=I c.C0=s.CFrame:inverse()*I.CFrame c.Parent=s return c end return module


function module.getSide(p,s)
	local cf = p.CFrame
	if s.x > 0 then
		return (cf*CFrame.fromAxisAngle(Vector3.new(0,-1,0),math.pi/2)).lookVector
	elseif s.x < 0 then
		return (cf*CFrame.fromAxisAngle(Vector3.new(0,1,0),math.pi/2)).lookVector
	end
	
	if s.y < 0 then
		return (cf*CFrame.fromAxisAngle(Vector3.new(-1,0,0),math.pi/2)).lookVector
	elseif s.y > 0 then
		return (cf*CFrame.fromAxisAngle(Vector3.new(1,0,0),math.pi/2)).lookVector
	end
	
	if s.z < 0 then
		return cf.lookVector
	elseif s.z > 0 then
		return -cf.lookVector
	end
end

function module.debounce(func)
	local debounce = false
	return function(...)
		if not debounce then
			debounce = true
			func(...)
			debounce = false
		end
	end
end

function module.part(p)
	local parts = {}
	local function getParts(m)
		for _,v in pairs(m:GetChildren()) do
			if v:IsA("Part") and v ~= p then
				table.insert(parts,#parts+1,v)
			elseif v:IsA("Model") then
				getParts(v)
			end
		end
	end
	getParts(game.Workspace)
	local winner = {}
	for _,q in pairs(parts) do
		local mag = (q.Position-p.Position).magnitude
		if mag < winner[1] then
			winner[1] = mag
			winner[2] = q
		end
	end
	return winner[2]
end

function module.weld(p1,p2)
	local w = Instance.new("Weld")
	w.Part0 = p1
	w.Part1 = p2
	w.C0 = p1.CFrame:inverse() * p2.CFrame
	w.Parent = p1
	return w
end
return module
