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

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
