SYNC_RATE:Connect(function()for l,b in ipairs(ActiveHitboxes)do if b.deleted then Handler:remove(b.object)else for l,A in ipairs(b.points)do if not b.active then A.LastPosition=nil else local l,L,K=A.solver:solve(A,b.debugMode)local a=workspace:Raycast(l,L,b.raycastParams)A.solver:lastPosition(A,K)if a then local l=a.Instance local L=not b.partMode and l:FindFirstAncestorOfClass("\077\111\100\101\108")local K=L and L:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")local Z=K or b.partMode and l if Z and not b.targetsHit[Z]then b.targetsHit[Z]=true b.OnHit:Fire(l,K,a,A.group)end end b.OnUpdate:Fire(A.LastPosition)end end end end end)return Handler

SYNC_RATE:Connect(function()
	for Index, Object in ipairs(ActiveHitboxes) do
		if Object.deleted then
			Handler:remove(Object.object)
		else
			for _, Point in ipairs(Object.points) do
				if not Object.active then
					Point.LastPosition = nil
				else
					local rayStart, rayDir, RelativePointToWorld = Point.solver:solve(Point, Object.debugMode)
					local raycastResult = workspace:Raycast(rayStart, rayDir, Object.raycastParams)
					Point.solver:lastPosition(Point, RelativePointToWorld)

					if raycastResult then
						local hitPart = raycastResult.Instance
						local findModel = not Object.partMode and hitPart:FindFirstAncestorOfClass("Model")
						local humanoid = findModel and findModel:FindFirstChildOfClass("Humanoid")
						local target = humanoid or (Object.partMode and hitPart)

						if target and not Object.targetsHit[target] then
							Object.targetsHit[target] = true
							Object.OnHit:Fire(hitPart, humanoid, raycastResult, Point.group)
						end
					end
					
					Object.OnUpdate:Fire(Point.LastPosition)
				end
			end
		end
	end
end)

return Handler
